Commit Graph

95111 Commits

Author SHA1 Message Date
Michael Niedermayer
c5a52eb5cd avcodec/loco: Check for end of input in the first line
Fixes: Timeout (85sec -> 0.1sec)
Fixes: 17634/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5666410809786368

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
2acbbe2623 avcodec/atrac3: Check block_align
Fixes: Infinite loop
Fixes: 17620/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3_fuzzer-5086123012915200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
ec4ad6fb9e tools/target_dec_fuzzer: Print samples decoded like pixels
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
db614008bc tools/target_dec_fuzzer: Check number of all samples decoded too, like max pixels
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
581a895c5c avcodec/alsdec: Avoid dereferencing context pointer in inner interleave loop
This makes the decoder faster

Improves/Fixes: Timeout (22sec -> 20sec)
Testcase: 17619/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5078510820917248

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
b2785cd3ac avcodec/hcom: Check that there are dictionary entries
Fixes: out of array read
Fixes: 17617/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HCOM_fuzzer-5674970478280704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
cfa1937791 avcodec/fitsdec: Prevent division by 0 with huge data_max
Fixes: division by 0
Fixes: 15657/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FITS_fuzzer-5738154838982656

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
7dc0943d4a avcodec/dstdec: Fix integer overflow in samples_per_frame computation
Fixes: Timeout (? -> 2ms)
Fixes: 17616/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5198057947267072

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
972a0a818f avcodec/g729_parser: Check block_size
Fixes: Infinite loop
Fixes: 17611/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-5765134928052224

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
02fb6a2147 avcodec/sbcdec: Initialize number of channels
Fixes: out of array access
Fixes: 17609/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SBC_fuzzer-5758729319874560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Andreas Rheinhardt
8b0f949906 avcodec/exr: Fix undefined left shifts of negative numbers
Affected the FATE-tests exr-rgb-scanline-pxr24-half-uint32-13x9 and
exr-rgb-scanline-pxr24-uint32.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
James Almer
58aa0ed8f1 aformat/movenc: add missing padding to output track extradata
Fixes ticket #8183.

Tested-by: Thierry Foucu <tfoucu@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-26 15:19:00 -03:00
Gyan Doshi
b9f8ab3ef4 doc/filters: warn about gaps/overlaps in xstack 2019-09-26 21:47:55 +05:30
Limin Wang
af007e36d1 doc/filters: add 4x4 layout example for xstack filter
Add layouts for existing examples.

Reviewed-by: Gyan <ffmpeg@gyani.pro>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-09-26 21:44:28 +05:30
James Almer
1dbd3c6116 avfilter/vf_eq: fix compilation with x86 asm disabled
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-26 12:19:43 -03:00
Paul B Mahol
1ac0d5513e fate: update hashes after ya16 change 2019-09-26 16:59:14 +02:00
Paul B Mahol
ccd18b4731 swresample/audioconvert: fix invalid left shift for 64bit sample format
Fixes #8002.
2019-09-26 16:22:47 +02:00
Andriy Gelman
80e1c93c87 avcodec/hevc_ps: Remove dead code in vps_id check
Since reading 4 bits always returns a value in the range [0, 15], the
check for vps_id >= HEVC_MAX_VPS_COUNT, where HEVC_MAX_VPS_COUNT = 16, is redundant.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-26 11:20:14 -03:00
Paul B Mahol
9b611deef1 avcodec/truespeech: fix left shift of negative value 2019-09-26 16:05:15 +02:00
Paul B Mahol
21838cad2f swscale/output: fix signed integer overflow for ya16
Fixes #7666.
2019-09-26 15:56:47 +02:00
Andreas Rheinhardt
646799b42f avformat/movenc: Fix undefined shift
Fixes the movenc FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-09-26 14:12:24 +02:00
Andreas Rheinhardt
093b6894bf avcodec/mpeg12dec: Sanitize start codes earlier
The MPEG-1/2 decoder uses avpriv_find_start_code to search for start
codes and worked with the resulting start code before checking that it
is really a start code of a slice. In particular, if the picture is so
big that a slice_vertical_position_extension is present, it added the
slice_vertical_position_extension as if it had a slice. Then a left
shift is performed, without making sure that the value to be shifted is
nonnegative.
Afterwards the end result is checked, but even if a start code of a
non-slice has been found, it might pass these checks: If
slice_vertical_position_extension is present a start code <
SLICE_MIN_START_CODE can lead to a macroblock-row index that appears
valid. Furthermore, the left shift might make an invalid start code
appear valid by discarding the highest bit.
This has been fixed by checking directly after avpriv_find_start_code
has returned.

Fixes ticket #8162 (which is about the undefined left shifts).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-09-26 14:09:14 +02:00
Andreas Rheinhardt
5886153dc3 avcodec/pcm: Cosmetics
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-09-26 14:06:06 +02:00
Andreas Rheinhardt
69473bec6f avcodec/pcm: Fix undefined shifts
Fixes the acodec-pcm-u16[lb]e FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-09-26 14:02:56 +02:00
Andreas Rheinhardt
84974c6fb5 avcodec/wavpackenc: Fix undefined shifts
Fixes ticket #8161 and the acodec-wavpack FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-09-26 11:11:01 +02:00
Zhong Li
525de95679 lavc/qsv: add memory type message
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-09-26 13:44:11 +08:00
Zhong Li
74007dd86a lavc/qsv: Fix MSDK initialization failure in system memory mode
MSDK does not create internal acceleration device on Linux,
So MFXVideoCORE_SetHandle() is necessary.
It has been added for ff_qsv_init_session_device().
But missed for ff_qsv_init_internal_session() due to commit
1f26a23 overwrited commit db89f45

Fix #7030

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-09-26 13:44:02 +08:00
Andreas Rheinhardt
b6be2be765 avformat/utils: ensure that all packets in AVPacketList are reference counted
This is done so that its data is really owned by the packet.
This was already true for the current callers.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-25 21:54:18 -03:00
Ting Fu
4f589d668e avfilter/x86/vf_eq: add SSE2 version
Signed-off-by: Ting Fu <ting.fu@intel.com>
2019-09-26 08:12:36 +08:00
Ting Fu
6aff2042d6 avfilter/x86/vf_eq: Change inline assembly into nasm code
Signed-off-by: Ting Fu <ting.fu@intel.com>
2019-09-26 08:11:13 +08:00
Ting Fu
9691e2a426 checkasm/vf_eq: add test for vf_eq
Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
2019-09-26 08:10:31 +08:00
Andreas Rheinhardt
fc20ba9e04 avformat/utils: Move the reference to the packet list
Up until now, ff_packet_list_put had a flaw: When it moved a packet to
the list (meaning, when it ought to move the reference to the packet
list instead of creating a new one via av_packet_ref), it did not reset
the original packet, confusing the ownership of the data in the packet.
This has been done because some callers of this function were not
compatible with resetting the packet.

This commit changes these callers and fixes this flaw. In order to
indicate that the ownership of the packet has moved to the packet list,
pointers to constant AVPackets are used whenever the target of the
pointer might already be owned by the packet list.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-25 20:53:09 -03:00
James Almer
bae8844e35 avformat/utils: unref packet on AVInputFormat.read_packet() failure
Demuxers may have allocated a packet before encountering an error and aborting.

Fixes ticket #8150

Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-25 20:53:05 -03:00
Andreas Rheinhardt
66d5e43b99 avformat/utils: Fix memleaks
ff_read_packet had potential memleaks:
1. If av_packet_make_refcounted fails, it means that the packet is not
refcounted, but it could nevertheless carry side data and therefore
needs to be unreferenced.
2. If putting a packet on a packet list fails, it wasn't unreferenced.

Furthermore, read_frame_internal leaked a packet's (side) data if a
context update was required and failed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-25 20:53:01 -03:00
Andreas Rheinhardt
e045be92cd avformat/utils: Assert that stream_index is valid
There is currently an ordinary check for this (which would lead to a
memleak), but given that no demuxer should ever return a packet with an
invalid stream_index it is more appropriate for this to be an assert.

FATE passes with this change.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-25 20:53:01 -03:00
Jun Li
c23797bc33 lavf/mov: Fix timestamp rescale on sidx atom
Fix #5090
Fix the timestamp rescale issue, from sidx timebase to
stream's timebase.
2019-09-26 06:55:44 +08:00
Carl Eugen Hoyos
dbd3dbb476 Revert "lavc/tiff: correct the default value of YCbCrSubsampling to 2x2"
This reverts commit eb5d0f18ff.

Together with 89f464e9, it breaks decoding of tiff files like fate-suite/exif/image_small.tiff
2019-09-26 00:34:44 +02:00
Limin Wang
3def984a98 avcodec/dnxhdenc: return error if av_malloc failed
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-25 17:56:44 -03:00
Paul B Mahol
ced3b8c61e avfilter/vf_zoompan: fix leaks 2019-09-25 21:48:59 +02:00
Paul B Mahol
20242bc762 avfilter/vf_zoompan: forward status back from output to input 2019-09-25 21:37:26 +02:00
Paul B Mahol
631f7acc6c avfilter/vf_stack: add slice threading 2019-09-25 19:02:57 +02:00
Paul B Mahol
44095564d4 avfilter/vf_stack: simplify main processing path 2019-09-25 18:40:56 +02:00
Paul B Mahol
1a17a66b09 avformat/sdsdec: fix undefined behaviour
Fixes #8163, #8164, #8165.
2019-09-25 18:01:09 +02:00
Paul B Mahol
d58752bcb9 avformat/aiffdec: fix signed integer overflow
Fixes #8151
2019-09-25 17:40:50 +02:00
Michael Niedermayer
121bf1b3b8 avcodec/decode: Check max_samples in get_buffer_internal()
This checks max_samples at the same level as max_pixels

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-25 17:21:23 +02:00
Michael Niedermayer
68c80dc312 tools/target_dec_fuzzer: Set max_samples
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-25 17:18:37 +02:00
Michael Niedermayer
f8406ab4b9 avcodec: add max_samples
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-25 17:18:37 +02:00
Paul B Mahol
402dbd4633 avfilter/Makefile: fix case for sierpinski 2019-09-25 14:15:55 +02:00
Paul B Mahol
9c3e1c1937 avfilter: add sierpinski video source 2019-09-25 14:06:26 +02:00
Paul B Mahol
55b32584b8 avfilter/vf_premultiply: forward status back from output to all input links 2019-09-25 13:07:04 +02:00