Some implementations of strftime do not like invalid values for
month/day, so ensure it doesn't happen.
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Correct bit mask for month/day/hour/min/sec values.
For reference the timestamp format specified in S377M is as follow:
year (int16), month (uint8), day (uint8), hour (uint8), sec (uint8),
msec (uint8).
A value of 0 for every fields means timestamp "unknown".
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
MSVC lacks support for %T and %F, but the standard specifies them
only as shorthands to the long variants.
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit '9e6b5e61a0c91e25e298d0a21b189c4c95443795':
img2enc: add an option for overwriting one file with subsequent images
Conflicts:
doc/muxers.texi
libavformat/img2enc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Fixes an overflow of the sample count field within the audio stream header
chunk if audio stream data exceeds 2GB.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes audio packet pts values in some files generated by AVID TRMG 3.01.
Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
srtp: Include rtpdec.h for RTP_MAX_PACKET_LENGTH
rtpdec: Increase max rtp packet size to 8192
lavf: Use RTP_MAX_PACKET_LENGTH instead of 1500
h264pred: Add a few missing const declarations for ff_cropTbl derived pointers
Merged-by: Michael Niedermayer <michaelni@gmx.at>
WAV chunks must be even aligned. This patch skip the extra padding byte
if chunk size is odd.
Fixes ticket #2417.
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'd1016dccdcb10486245e5d7c186cc31af54b2a9c':
xmv: check audio track parameters validity.
bmv: check for len being valid in bmv_decode_frame().
Conflicts:
libavformat/xmv.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '8d617b11cfc87b2c6056fee029ac5bc760af874a':
id3v2: pad the APIC packets as required by lavc.
dfa: check for invalid access in decode_wdlt().
Conflicts:
libavformat/id3v2.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'bcc94328980e6c56546792ab08b0756abdce310b':
opt: check the return values of av_get_token for ENOMEM.
doc: Fix best_nb_channells typo
matroska: pass the lace size to the matroska_parse_rm_audio
Conflicts:
libavformat/matroskadec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '8a96df7b70be509dae9ceec82d2c10a20361356d':
matroska: fix a corner case in ebml-lace parsing
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Each lace must be independent according to the specification.
Fix heap-buffer-overflow in matroska_parse_block for
corrupted real media in mkv files.
Stricter check than fc43c19a56
CC: libav-stable@libav.org
Fix heap-buffer-overflow in matroska_parse_block for
corrupted real media in mkv files.
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
The sample rate index is 3 bits even if currently index 5, 6 and 7 are
not supported.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Partial fix for ticket #2412 in that using PIX_FMT_BGR24 fixes the
swapped channels issue when using scripts serving RGB24.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c3d015775388882b8a122afc337ea35108f652be':
flvdec: use the correct audio codec id when parsing metadata
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Fixes double free
Regression since the new buffer references, thus no FFmpeg
releases should be affected
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This solution uses the size of the first RIFF if its valid
to check frame size validity when the filesize could not be determined.
Feedback is welcome, other ideas and improvments as well!
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'cf53704c55378cc0dcfc16637cdac7d58f0b3107':
AVOptions: make av_set_options_string() forward options to child objects
win32: Use 64-bit fstat/lseek variants for MSVC as well
win32: Make ff_win32_open more robust
Conflicts:
libavformat/os_support.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
- Make MultiByteToWideChar fail when it encounters invalid encoding.
Without this, invalid characters might just be skipped
- When MultiByteToWideChar fails, assume the file name is in CP_ACP
and open it via normal open function, even when the file will be
written
- When malloc fails return error instead of crashing
Signed-off-by: Martin Storsjö <martin@martin.st>
In order to match Linux behaviour better our Windows-specific
open() replacement should disable Windows default file locking.
Signed-off-by: Martin Storsjö <martin@martin.st>
Many video players accept broken frames in a transport stream, so there
is no reason to abort remuxing when encountering one, just print a
warning instead.
Fixes ticket #1758.
Also move the declaration to internal.h, and add restrict qualifiers
to the declaration (as in the implementation).
Signed-off-by: Martin Storsjö <martin@martin.st>
Dynamically loads the library itself, rather than through VfW.
Supports AvxSynth on Linux and OS X.
Supports the new colorspaces added in AviSynth 2.6 when used
with AviSynth 2.6.
* cigaes/master:
lavfi/vf_yadif: use standard options parsing.
lavfi/vf_unsharp: use standard options parsing.
lavfi/vf_transpose: use standard options parsing.
lavfi/vf_pad: use standard options parsing.
lavfi/vf_fps: use standard options parsing.
lavfi/vf_fade: use standard options parsing.
lavi/vf_drawbox: use standard options parsing.
lavfi/vf_delogo: use standard options parsing.
lavfi/vf_decimate: use standard options parsing.
lavfi/vf_crop: use standard options parsing.
lavfi/af_volume: use standard options parsing.
lavfi/vf_tile: use standard options parsing.
lavfi/avf_concat: use standard options parsing.
lavfi: add common code to handle options parsing.
lavf/vobsub: free index pseudo-packet.
ffmpeg: fix freeing of sub2video frame.
lavfi: add sine audio source.
lavu/opt: add AV_OPT_TYPE_DURATION.
lavfi/concat: fix silence duration computation.
lavf/concatdec: support seeking.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This patch adds the enums for the ContentEncryption elements.
This patch also adds support for parsing the ContentEncKeyID. The
ContentEncKeyID is then base64 encoded and stored in the stream's
metadata.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit '2c328a907978b61949fd20f7c991803174337855':
pixdesc: add a function for counting planes in a pixel format.
avplay: remove the -debug option.
Revert "asfenc: return error on negative timestamp"
Conflicts:
doc/APIchanges
doc/ffplay.texi
ffplay.c
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
do_adobe_auth takes the parameters in the order "opaque, challenge".
Due to the way they are treated, this didn't matter in the tested
setups though - if both are set, we only use one. In the tested
setups (Wowza and Akamai) either one of them were null or they
were both set to the same value, which is why this worked before.
Signed-off-by: Martin Storsjö <martin@martin.st>
Problem found using ASAN.
In some case, the ff_mov_get_channel_layout_tag function will not find 0
as termination for lookup in the array mov_ch_layouts_wav.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The two types of packets (PCI and DSI) are passed untouched but combined by the new codec ID AV_CODEC_ID_DVD_NAV.
The first 980 bytes in the packet contain the PCI data. The next 1018 are the DSI data.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This is admittedly kind of pointless since usually -f image2pipe
can be used for the purpose, but this is more user-friendly.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Otherwise ffmpeg -formats claims that we only support demuxing
of that format.
To keep compatibility the struct could be duplicated instead,
but this seems almost like overkill for such a rare format.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
- Make MultiByteToWideChar fail when it encounters invalid encoding.
Without this, invalid characters might just be skipped
- When MultiByteToWideChar fails, assume the file name is in CP_ACP
and open it via normal open function, even when the file will be
written
- When malloc fails return error instead of crashing
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
To avoid allocating ridiculous amounts of memory for corrupted files,
read the input in chunks limited to filesize or an arbitrary large
amount when that is not known (chosen to be 50M).
* commit 'b164d66e35d349de414e2f0d7365a147aba8a620':
ape: make version-dependent decoding functions called via pointers
mpegts: add support for stream_type 0x42, which is CAVS
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Simplify `p->buf > p->buf + p->buf_size - 4' as `p->buf_size < 4'.
Avoid a possible out-of-bounds pointer, which is undefined behavior
in C.
CC: libav-stable@libav.org
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* commit 'a4472ac01e86f9fae5adb9034f2777b86a9c5480':
Add informative messages to av_log_ask_for_sample calls lacking them
anm: Get rid of some very silly goto statements
Conflicts:
libavformat/anm.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '85a5bc054c1290699ccbf5799ba6c4e2fbcc3530':
lavf: remove disabled FF_API_R_FRAME_RATE cruft
Conflicts:
libavformat/avformat.h
libavformat/electronicarts.c
libavformat/rawdec.c
libavformat/utils.c
libavformat/version.h
The field is in use and no semantically equivalent field is available,
thus not removed
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '3e2f200237af977b9253b0aff121eee27bcedb44':
roqvideodec: fix a potential infinite loop in roqvideo_decode_frame().
xxan: fix invalid memory access in xan_decode_frame_type0()
tty: set avg_frame_rate.
FATE: enable multiple slices in the ffv1 vsynth test
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '7b89cd20d844cbe763ca34e63e99d110043cf241':
eamad: allocate a dummy reference frame when the real one is missing
Replace remaining includes of audioconvert.h with channel_layout.h
Replace some forgotten instances of PIX_FMT_* with AV_PIX_FMT_*.
Conflicts:
libavcodec/h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.
When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Fixes use of uninitialized variables and possible out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This reverts commit 6cc12353a8.
Conflicts:
libavformat/version.h
Allowing to automatically select the concat demuxer raises
security concerns, as it allows a possibly hostile file to
access any file on the system. Guessing the format based on
the file name extension does not allow to enable the safe
mode designed to avoid it.
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.
When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.
Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cehoyos/master:
buildsys: only include log2_tab per library for shared builds
Add h264chroma dependency for cavs decoder to configure.
Add h264qpel dependency for snow codec to configure.
Add h264chroma dependency for vp5 and vp6 decoder to configure.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
As far as I can tell the code should not change behaviour
depending on locale in any of these places.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
The warnings are false positives, older gcc versions (such as 4.5)
think the variables can be used uninitialized while they in
practice can't, while newer (4.6) gets it right.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit 'e671d3ad6cd7fe1d02e9b35b889a25d8c059fce9':
h264: do not copy ref count/ref2frm when updating per-frame context
flvdec: Check the return value of a malloc
Conflicts:
libavformat/flvdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c91c63b5380bf79655c09320774a022f84d76fd5':
flvdec: Don't read the VP6 header byte when setting codec type based on metadata
Conflicts:
libavformat/flvdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The callers of this function can't report errors sanely. If this
one malloc fails, don't write the extradata byte, make sure we
try to malloc it the next time we're called instead, and make sure
we still consume the input data byte.
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
This header byte is only present when actually reading a VP6 frame,
not when reading the codec type field in the metadata. This
potential bug has been present since 5b54a90c.
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
If the first "special" character in a filename is a comma,
it can introduce protocol options, but only if there is a
colon at the end. Otherwise, it is just a filename with a
comma.
Fix trac ticket #2303.
Fix trac ticket #2300 because the duration of the segments
was computed using the timestamp of the last packet plus its
duration using the 1/90000 default time base instead of using
the chained muxer time base.
* qatar/master:
lavf: Add a fate test for the noproxy pattern matching
lavf: Handle the environment variable no_proxy more properly
Conflicts:
libavformat/Makefile
libavformat/internal.h
libavformat/tls.c
libavformat/utils.c
libavformat/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This reverts commit 4a8fc1d83b.
The commit caused null pointer derefernces when using udp://
after i fixed that it caused ffmpeg to get stuck and remapped
arguments like ?ttl=255 -> ?ttl%3d255
I dont want to leave this broken thus temporary revert so we all
have some time to look at this without half the network protocols
being broken in the meantime
The handling of the environment variable no_proxy, present since
one of the initial commits (de6d9b6404), is inconsistent with
how many other applications and libraries interpret this
variable. Its bare presence does not indicate that the use of
proxies should be skipped, but it is some sort of pattern for
hosts that does not need using a proxy (e.g. for a local network).
As investigated by Rudolf Polzer, different libraries handle this
in different ways, some supporting IP address masks, some supporting
arbitrary globbing using *, some just checking that the pattern matches
the end of the hostname without regard for whether it actually is
the right domain or a domain that ends in the same string.
This simple logic should be pretty similar to the logic used by
lynx and curl.
Signed-off-by: Martin Storsjö <martin@martin.st>
As the name indicates we can't just assume what the
"opaque" field contains.
This fixes a crash in third-party applications see e.g.:
http://bugzilla.mplayerhq.hu/show_bug.cgi?id=2126
This fixes also FFmpeg trac #2293, which is a different
third-party application.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* commit '56daf10e0313c5e36f43e773f457d2a99ff0df10':
mov: use the format context for logging.
flicvideo: avoid an infinite loop in byte run compression
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Avoid to write more than one cuepoint per track and PTS in
mkv_write_cues(). This avoids a later assertion failure on "(bytes >=
needed_bytes)" in put_ebml_num() called from end_ebml_master(), in case
there are several cuepoints per track with the same PTS.
This may happen with files containing packets with duplicated PTS in the
same track.