]> git.sesse.net Git - ffmpeg/log
ffmpeg
5 years agoavfilter/vf_framerate: limit the scene level max range
Limin Wang [Tue, 24 Sep 2019 10:18:07 +0000 (18:18 +0800)]
avfilter/vf_framerate: limit the scene level max range

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoavcodec/motionpixels: Mark 2 functions as always_inline
Michael Niedermayer [Sun, 11 Aug 2019 20:28:09 +0000 (22:28 +0200)]
avcodec/motionpixels: Mark 2 functions as always_inline

Fixes: Timeout (30sec -> 25sec)
Fixes: 17050/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOTIONPIXELS_fuzzer-5719149803732992
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/ituh263dec: Make the condition for the studio slice start code match between...
Michael Niedermayer [Sat, 14 Sep 2019 16:31:40 +0000 (18:31 +0200)]
avcodec/ituh263dec: Make the condition for the studio slice start code match between ff_h263_resync() and ff_mpeg4_decode_studio_slice_header()

If they mismatch an infinite loop can occur
Fixes: Timeout (infinite loop)
Fixes: 17043/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5695051748868096
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/ralf: Fix integer overflow in decode_channel()
Michael Niedermayer [Sat, 14 Sep 2019 12:26:49 +0000 (14:26 +0200)]
avcodec/ralf: Fix integer overflow in decode_channel()

Fixes: signed integer overflow: -1094995519 * 64 cannot be represented in type 'int'
Fixes: 17030/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5640695838146560
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agovcodec/vc1: compute rangex/y only for P/B frames
Michael Niedermayer [Tue, 10 Sep 2019 18:20:31 +0000 (20:20 +0200)]
vcodec/vc1: compute rangex/y only for P/B frames

Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int'
Fixes: 16976/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-4847262047404032
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/vc1_pred: Fix invalid shifts in scaleforopp()
Michael Niedermayer [Tue, 10 Sep 2019 16:57:25 +0000 (18:57 +0200)]
avcodec/vc1_pred: Fix invalid shifts in scaleforopp()

Fixes: left shift of negative value -2
Fixes: 16964/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5757853565976576
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/vc1_block: Fix invalid shift with rangeredfrm
Michael Niedermayer [Tue, 10 Sep 2019 15:39:45 +0000 (17:39 +0200)]
avcodec/vc1_block: Fix invalid shift with rangeredfrm

Fixes: left shift of negative value -7
Fixes: 16959/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-5200360825683968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/vc1: Check for excessive resolution
Michael Niedermayer [Thu, 8 Aug 2019 17:30:50 +0000 (19:30 +0200)]
avcodec/vc1: Check for excessive resolution

Fixes: overflow in aspect ratio calculation
Fixes: signed integer overflow: 393215 * 14594 cannot be represented in type 'int'
Fixes: 15728/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5661588893204480
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/vc1: check REFDIST
Michael Niedermayer [Sat, 31 Aug 2019 20:00:35 +0000 (22:00 +0200)]
avcodec/vc1: check REFDIST

"9.1.1.43 P Reference Distance (REFDIST)"
"The value of REFDIST shall be less than, or equal to, 16."

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/apedec: Allocate decoded_buffer after successful ff_get_buffer()
Michael Niedermayer [Mon, 2 Sep 2019 22:02:53 +0000 (00:02 +0200)]
avcodec/apedec: Allocate decoded_buffer after successful ff_get_buffer()

We need to reset samples in this case to avoid being stuck with incorrect
samples value.

Fixes: OOM
Fixes: Timeout
Fixes: 16627/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5638059583864832
Fixes: 17089/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5672188463546368
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/apedec: Fix several integer overflows in predictor_update_filter() and do_app...
Michael Niedermayer [Mon, 2 Sep 2019 20:59:55 +0000 (22:59 +0200)]
avcodec/apedec: Fix several integer overflows in predictor_update_filter() and do_apply_filter()

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: signed integer overflow: -14527961 - 2147483425 cannot be represented in type 'int'
Fixes: 16380/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5645957131141120
Fixes: 16968/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5716169901735936
Fixes: 17074/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5198710497083392
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/hevc_cabac: Tighten the limit on k in ff_hevc_cu_qp_delta_abs()
Michael Niedermayer [Mon, 9 Sep 2019 21:23:20 +0000 (23:23 +0200)]
avcodec/hevc_cabac: Tighten the limit on k in ff_hevc_cu_qp_delta_abs()

Values larger would fail subsequent tests.

Fixes: signed integer overflow: 5 + 2147483646 cannot be represented in type 'int'
Fixes: 16966/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5695709549953024
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavfilter/vf_xbr: Fix left shift of negative number
Andreas Rheinhardt [Sat, 28 Sep 2019 02:25:56 +0000 (04:25 +0200)]
avfilter/vf_xbr: Fix left shift of negative number

Affected every usage of vf_xbr, e.g. the FATE-tests filter-2xbr,
filter-3xbr, filter-4xbr.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavfilter/vf_hqx: Fix undefined left shifts of negative numbers
Andreas Rheinhardt [Sat, 28 Sep 2019 02:25:57 +0000 (04:25 +0200)]
avfilter/vf_hqx: Fix undefined left shifts of negative numbers

Affected every usage of this filter; in particular, it affected the
FATE-tests filter-2xbr, filter-3xbr and filter-4xbr.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/jpeg2000dwt: Fix undefined shifts of negative numbers
Andreas Rheinhardt [Sat, 28 Sep 2019 02:26:10 +0000 (04:26 +0200)]
avcodec/jpeg2000dwt: Fix undefined shifts of negative numbers

Affected the vsynth*-jpeg2000 and the vsynth*-jpeg2000-97 FATE tests
(where * ranges over { 1, 2, 3, _lena }) as well as ticket #7983.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/ituh263dec: Fix undefined left shift of negative number
Andreas Rheinhardt [Sat, 28 Sep 2019 02:26:07 +0000 (04:26 +0200)]
avcodec/ituh263dec: Fix undefined left shift of negative number

Fixes ticket #8160.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/dnxhdenc: Fix undefined left shifts of negative numbers
Andreas Rheinhardt [Sat, 28 Sep 2019 02:26:06 +0000 (04:26 +0200)]
avcodec/dnxhdenc: Fix undefined left shifts of negative numbers

Affected 61 FATE-tests: 60 vsynth tests and lavf-mxf_opatom.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoswscale/utils: Fix invalid left shifts of negative numbers
Andreas Rheinhardt [Sat, 28 Sep 2019 02:26:02 +0000 (04:26 +0200)]
swscale/utils: Fix invalid left shifts of negative numbers

Affected the FATE-tests vsynth_lena-dv-411, vsynth1-dv-411,
vsynth2-dv-411 and hevc-paramchange-yuv420p.yuv420p10.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/ffv1enc: Fix out-of-bounds-array access
Andreas Rheinhardt [Sat, 28 Sep 2019 02:26:01 +0000 (04:26 +0200)]
avcodec/ffv1enc: Fix out-of-bounds-array access

libavcodec/ffv1enc.c accessed an array of uint8_t [32] via array[0][j]
in order to loop over all the uint8_t in this array of arrays. Of course
this implied an out-of-bounds access for array[0] and UBSan complained
about this. So replace this with nested loops; furthermore, factor this
out into a function of its own to easily break out of the nested loops.

This affected the FATE-tests vsynth1-ffv1, vsynth1-ffv1-v3-yuv420p,
vsynth1-ffv1-v3-yuv422p10, vsynth1-ffv1-v3-yuv444p16,
vsynth1-ffv1-v3-bgr0, vsynth1-ffv1-ffv1-v3-rgb48 as well as the
corresponding vsynth2-*, vsynth3-* and the vsynth_lena-* tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoswscale/x86/swscale: Fix undefined left shifts of negative numbers
Andreas Rheinhardt [Sat, 28 Sep 2019 02:25:58 +0000 (04:25 +0200)]
swscale/x86/swscale: Fix undefined left shifts of negative numbers

This affected many FATE-tests: The number of failing tests went down
from 663 to 344. (Both numbers exclude tests that failed because of
unaligned accesses in code that is inside #if HAVE_FAST_UNALIGNED.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoffmpeg_opt: remove errant space
Lou Logan [Fri, 27 Sep 2019 23:17:15 +0000 (15:17 -0800)]
ffmpeg_opt: remove errant space

Signed-off-by: Lou Logan <lou@lrcd.com>
5 years agodoc/ffmpeg: -timelimit is in user time
Lou Logan [Thu, 26 Sep 2019 18:18:57 +0000 (10:18 -0800)]
doc/ffmpeg: -timelimit is in user time

Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/nvenc: make use of new GetLastErrorString function
Timo Rothenpieler [Fri, 27 Sep 2019 17:09:11 +0000 (19:09 +0200)]
avcodec/nvenc: make use of new GetLastErrorString function

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
5 years agoavcodec/nvenc: pass CUstream to nvenc when available
Timo Rothenpieler [Fri, 27 Sep 2019 16:30:10 +0000 (18:30 +0200)]
avcodec/nvenc: pass CUstream to nvenc when available

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
5 years agoavcodec/nvenc: add multiple reference frames support
Roman Arzumanyan [Fri, 27 Sep 2019 15:56:11 +0000 (17:56 +0200)]
avcodec/nvenc: add multiple reference frames support

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
5 years agoavcodec/nvenc: switch to dedicated dpb_size option
Timo Rothenpieler [Fri, 27 Sep 2019 15:55:23 +0000 (17:55 +0200)]
avcodec/nvenc: switch to dedicated dpb_size option

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
5 years agolibavformat/rtsp: return error if rtsp_hd_out is null instead of crash
Ross Nicholson [Thu, 19 Sep 2019 15:12:33 +0000 (16:12 +0100)]
libavformat/rtsp: return error if rtsp_hd_out is null instead of crash

Signed-off-by: Aman Gupta <aman@tmm1.net>
5 years agolavu/qsv: remove redundant version query
Zhong Li [Thu, 19 Sep 2019 20:45:25 +0000 (04:45 +0800)]
lavu/qsv: remove redundant version query

Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agolavc/mpeg4audio: add chan_config check to avoid indeterminate channels
Jun Zhao [Sat, 21 Sep 2019 11:29:47 +0000 (19:29 +0800)]
lavc/mpeg4audio: add chan_config check to avoid indeterminate channels

add chan_config check to avoid indeterminate channels.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavcodec/mpeg4audio: fix doxy for ff_mpeg4audio_get_config_gb()
James Almer [Fri, 27 Sep 2019 13:43:36 +0000 (10:43 -0300)]
avcodec/mpeg4audio: fix doxy for ff_mpeg4audio_get_config_gb()

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavformat: use avpriv_mpeg4audio_get_config2()
James Almer [Sat, 21 Sep 2019 23:06:48 +0000 (20:06 -0300)]
avformat: use avpriv_mpeg4audio_get_config2()

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavcodec: use avpriv_mpeg4audio_get_config2()
James Almer [Sat, 21 Sep 2019 23:04:33 +0000 (20:04 -0300)]
avcodec: use avpriv_mpeg4audio_get_config2()

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavcodec/mpeg4audio: add avpriv_mpeg4audio_get_config2()
James Almer [Sat, 21 Sep 2019 22:57:11 +0000 (19:57 -0300)]
avcodec/mpeg4audio: add avpriv_mpeg4audio_get_config2()

Identical to avpriv_mpeg4audio_get_config() except taking a size argument in
bytes, and featuring a new logging context paremeter.

Schedule avpriv_mpeg4audio_get_config() for removal as soon as major is bumped
as well.

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavformat/dhav: fix demuxer since recent breakage
Paul B Mahol [Fri, 27 Sep 2019 12:25:18 +0000 (14:25 +0200)]
avformat/dhav: fix demuxer since recent breakage

5 years agoavformat/g729dec: set packet duration and correctly set timebase info
Paul B Mahol [Fri, 27 Sep 2019 10:38:23 +0000 (12:38 +0200)]
avformat/g729dec: set packet duration and correctly set timebase info

Fixes #6704.

5 years agoavformat/nut: add pcm_s64 support
Paul B Mahol [Fri, 27 Sep 2019 10:12:42 +0000 (12:12 +0200)]
avformat/nut: add pcm_s64 support

5 years agoswscale/swscale: cosmetics
Limin Wang [Thu, 26 Sep 2019 15:44:59 +0000 (23:44 +0800)]
swscale/swscale: cosmetics

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavfilter/vf_scale: cosmetics
Limin Wang [Thu, 26 Sep 2019 15:36:54 +0000 (23:36 +0800)]
avfilter/vf_scale: cosmetics

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/4xm: Check index in decode_i_block() also in the path where its not used.
Michael Niedermayer [Tue, 17 Sep 2019 17:53:45 +0000 (19:53 +0200)]
avcodec/4xm: Check index in decode_i_block() also in the path where its not used.

Fixes: Infinite loop
Fixes: signed integer overflow: 2147483644 + 16 cannot be represented in type 'int'
Fixes: 16169/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FOURXM_fuzzer-5662570416963584
Fixes: 16782/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FOURXM_fuzzer-5743163859271680
Fixes: 17641/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FOURXM_fuzzer-5711603562971136
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>
5 years agoavcodec/loco: Check for end of input in the first line
Michael Niedermayer [Wed, 25 Sep 2019 19:48:26 +0000 (21:48 +0200)]
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>
5 years agoavcodec/atrac3: Check block_align
Michael Niedermayer [Wed, 25 Sep 2019 18:51:22 +0000 (20:51 +0200)]
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>
5 years agotools/target_dec_fuzzer: Print samples decoded like pixels
Michael Niedermayer [Wed, 25 Sep 2019 18:41:42 +0000 (20:41 +0200)]
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>
5 years agotools/target_dec_fuzzer: Check number of all samples decoded too, like max pixels
Michael Niedermayer [Wed, 25 Sep 2019 18:40:55 +0000 (20:40 +0200)]
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>
5 years agoavcodec/alsdec: Avoid dereferencing context pointer in inner interleave loop
Michael Niedermayer [Wed, 25 Sep 2019 18:31:50 +0000 (20:31 +0200)]
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>
5 years agoavcodec/hcom: Check that there are dictionary entries
Michael Niedermayer [Wed, 25 Sep 2019 16:38:03 +0000 (18:38 +0200)]
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>
5 years agoavcodec/fitsdec: Prevent division by 0 with huge data_max
Michael Niedermayer [Mon, 15 Jul 2019 21:42:42 +0000 (23:42 +0200)]
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>
5 years agoavcodec/dstdec: Fix integer overflow in samples_per_frame computation
Michael Niedermayer [Wed, 25 Sep 2019 14:48:46 +0000 (16:48 +0200)]
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>
5 years agoavcodec/g729_parser: Check block_size
Michael Niedermayer [Tue, 24 Sep 2019 23:07:34 +0000 (01:07 +0200)]
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>
5 years agoavcodec/sbcdec: Initialize number of channels
Michael Niedermayer [Tue, 24 Sep 2019 21:50:23 +0000 (23:50 +0200)]
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>
5 years agoavcodec/exr: Fix undefined left shifts of negative numbers
Andreas Rheinhardt [Tue, 24 Sep 2019 22:03:07 +0000 (00:03 +0200)]
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>
5 years agoaformat/movenc: add missing padding to output track extradata
James Almer [Wed, 25 Sep 2019 17:21:07 +0000 (14:21 -0300)]
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>
5 years agodoc/filters: warn about gaps/overlaps in xstack
Gyan Doshi [Thu, 26 Sep 2019 16:16:55 +0000 (21:46 +0530)]
doc/filters: warn about gaps/overlaps in xstack

5 years agodoc/filters: add 4x4 layout example for xstack filter
Limin Wang [Thu, 26 Sep 2019 14:57:42 +0000 (22:57 +0800)]
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>
5 years agoavfilter/vf_eq: fix compilation with x86 asm disabled
James Almer [Thu, 26 Sep 2019 15:12:33 +0000 (12:12 -0300)]
avfilter/vf_eq: fix compilation with x86 asm disabled

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agofate: update hashes after ya16 change
Paul B Mahol [Thu, 26 Sep 2019 14:59:14 +0000 (16:59 +0200)]
fate: update hashes after ya16 change

5 years agoswresample/audioconvert: fix invalid left shift for 64bit sample format
Paul B Mahol [Thu, 26 Sep 2019 14:19:06 +0000 (16:19 +0200)]
swresample/audioconvert: fix invalid left shift for 64bit sample format

Fixes #8002.

5 years agoavcodec/hevc_ps: Remove dead code in vps_id check
Andriy Gelman [Sun, 22 Sep 2019 04:17:29 +0000 (00:17 -0400)]
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>
5 years agoavcodec/truespeech: fix left shift of negative value
Paul B Mahol [Thu, 26 Sep 2019 14:03:33 +0000 (16:03 +0200)]
avcodec/truespeech: fix left shift of negative value

5 years agoswscale/output: fix signed integer overflow for ya16
Paul B Mahol [Thu, 26 Sep 2019 13:55:03 +0000 (15:55 +0200)]
swscale/output: fix signed integer overflow for ya16

Fixes #7666.

5 years agoavformat/movenc: Fix undefined shift
Andreas Rheinhardt [Thu, 19 Sep 2019 22:17:03 +0000 (00:17 +0200)]
avformat/movenc: Fix undefined shift

Fixes the movenc FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavcodec/mpeg12dec: Sanitize start codes earlier
Andreas Rheinhardt [Thu, 19 Sep 2019 22:16:57 +0000 (00:16 +0200)]
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>
5 years agoavcodec/pcm: Cosmetics
Andreas Rheinhardt [Thu, 19 Sep 2019 22:17:02 +0000 (00:17 +0200)]
avcodec/pcm: Cosmetics

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavcodec/pcm: Fix undefined shifts
Andreas Rheinhardt [Thu, 19 Sep 2019 22:17:01 +0000 (00:17 +0200)]
avcodec/pcm: Fix undefined shifts

Fixes the acodec-pcm-u16[lb]e FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavcodec/wavpackenc: Fix undefined shifts
Andreas Rheinhardt [Thu, 19 Sep 2019 22:16:58 +0000 (00:16 +0200)]
avcodec/wavpackenc: Fix undefined shifts

Fixes ticket #8161 and the acodec-wavpack FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agolavc/qsv: add memory type message
Zhong Li [Thu, 19 Sep 2019 20:45:27 +0000 (04:45 +0800)]
lavc/qsv: add memory type message

Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agolavc/qsv: Fix MSDK initialization failure in system memory mode
Zhong Li [Thu, 19 Sep 2019 20:45:26 +0000 (04:45 +0800)]
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>
5 years agoavformat/utils: ensure that all packets in AVPacketList are reference counted
Andreas Rheinhardt [Thu, 26 Sep 2019 00:05:58 +0000 (02:05 +0200)]
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>
5 years agoavfilter/x86/vf_eq: add SSE2 version
Ting Fu [Wed, 18 Sep 2019 07:05:35 +0000 (15:05 +0800)]
avfilter/x86/vf_eq: add SSE2 version

Signed-off-by: Ting Fu <ting.fu@intel.com>
5 years agoavfilter/x86/vf_eq: Change inline assembly into nasm code
Ting Fu [Wed, 18 Sep 2019 07:05:34 +0000 (15:05 +0800)]
avfilter/x86/vf_eq: Change inline assembly into nasm code

Signed-off-by: Ting Fu <ting.fu@intel.com>
5 years agocheckasm/vf_eq: add test for vf_eq
Ting Fu [Wed, 18 Sep 2019 07:05:33 +0000 (15:05 +0800)]
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>
5 years agoavformat/utils: Move the reference to the packet list
Andreas Rheinhardt [Fri, 20 Sep 2019 20:39:10 +0000 (22:39 +0200)]
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>
5 years agoavformat/utils: unref packet on AVInputFormat.read_packet() failure
James Almer [Fri, 20 Sep 2019 20:39:09 +0000 (22:39 +0200)]
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>
5 years agoavformat/utils: Fix memleaks
Andreas Rheinhardt [Tue, 24 Sep 2019 16:31:44 +0000 (18:31 +0200)]
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>
5 years agoavformat/utils: Assert that stream_index is valid
Andreas Rheinhardt [Tue, 24 Sep 2019 16:31:43 +0000 (18:31 +0200)]
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>
5 years agolavf/mov: Fix timestamp rescale on sidx atom
Jun Li [Thu, 9 May 2019 09:07:56 +0000 (02:07 -0700)]
lavf/mov: Fix timestamp rescale on sidx atom

Fix #5090
Fix the timestamp rescale issue, from sidx timebase to
stream's timebase.

5 years agoRevert "lavc/tiff: correct the default value of YCbCrSubsampling to 2x2"
Carl Eugen Hoyos [Wed, 25 Sep 2019 22:34:44 +0000 (00:34 +0200)]
Revert "lavc/tiff: correct the default value of YCbCrSubsampling to 2x2"

This reverts commit eb5d0f18ff609ba2280cea4e2c6286d216c8756b.

Together with 89f464e9, it breaks decoding of tiff files like fate-suite/exif/image_small.tiff

5 years agoavcodec/dnxhdenc: return error if av_malloc failed
Limin Wang [Mon, 23 Sep 2019 03:36:18 +0000 (11:36 +0800)]
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>
5 years agoavfilter/vf_zoompan: fix leaks
Paul B Mahol [Wed, 25 Sep 2019 19:39:49 +0000 (21:39 +0200)]
avfilter/vf_zoompan: fix leaks

5 years agoavfilter/vf_zoompan: forward status back from output to input
Paul B Mahol [Wed, 25 Sep 2019 19:37:26 +0000 (21:37 +0200)]
avfilter/vf_zoompan: forward status back from output to input

5 years agoavfilter/vf_stack: add slice threading
Paul B Mahol [Wed, 25 Sep 2019 17:02:57 +0000 (19:02 +0200)]
avfilter/vf_stack: add slice threading

5 years agoavfilter/vf_stack: simplify main processing path
Paul B Mahol [Wed, 25 Sep 2019 16:40:56 +0000 (18:40 +0200)]
avfilter/vf_stack: simplify main processing path

5 years agoavformat/sdsdec: fix undefined behaviour
Paul B Mahol [Wed, 25 Sep 2019 16:01:09 +0000 (18:01 +0200)]
avformat/sdsdec: fix undefined behaviour

Fixes #8163, #8164, #8165.

5 years agoavformat/aiffdec: fix signed integer overflow
Paul B Mahol [Wed, 25 Sep 2019 15:36:52 +0000 (17:36 +0200)]
avformat/aiffdec: fix signed integer overflow

Fixes #8151

5 years agoavcodec/decode: Check max_samples in get_buffer_internal()
Michael Niedermayer [Wed, 25 Sep 2019 14:18:32 +0000 (16:18 +0200)]
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>
5 years agotools/target_dec_fuzzer: Set max_samples
Michael Niedermayer [Mon, 2 Sep 2019 22:04:00 +0000 (00:04 +0200)]
tools/target_dec_fuzzer: Set max_samples

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec: add max_samples
Michael Niedermayer [Mon, 2 Sep 2019 21:17:57 +0000 (23:17 +0200)]
avcodec: add max_samples

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavfilter/Makefile: fix case for sierpinski
Paul B Mahol [Wed, 25 Sep 2019 12:15:55 +0000 (14:15 +0200)]
avfilter/Makefile: fix case for sierpinski

5 years agoavfilter: add sierpinski video source
Paul B Mahol [Mon, 12 Aug 2019 07:20:08 +0000 (09:20 +0200)]
avfilter: add sierpinski video source

5 years agoavfilter/vf_premultiply: forward status back from output to all input links
Paul B Mahol [Wed, 25 Sep 2019 11:02:39 +0000 (13:02 +0200)]
avfilter/vf_premultiply: forward status back from output to all input links

5 years agoavfilter/vf_fieldmatch: forward status back from output to all input links
Paul B Mahol [Wed, 25 Sep 2019 10:55:43 +0000 (12:55 +0200)]
avfilter/vf_fieldmatch: forward status back from output to all input links

Fixes #8199.

5 years agoavfilter/vf_fieldmatch: fix more leaks
Paul B Mahol [Wed, 25 Sep 2019 10:35:33 +0000 (12:35 +0200)]
avfilter/vf_fieldmatch: fix more leaks

5 years agoavfilter/vf_v360: add sinusoidal format
Paul B Mahol [Wed, 25 Sep 2019 10:01:54 +0000 (12:01 +0200)]
avfilter/vf_v360: add sinusoidal format

5 years agolavc/tiff: correct the default value of YCbCrSubsampling to 2x2
Pavel Skakov [Wed, 25 Sep 2019 08:47:46 +0000 (10:47 +0200)]
lavc/tiff: correct the default value of YCbCrSubsampling to 2x2

5 years agolavf/4xm: fix memory leak in error handing path
Jun Zhao [Mon, 23 Sep 2019 02:50:21 +0000 (10:50 +0800)]
lavf/4xm: fix memory leak in error handing path

need to free the header in error path.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agolibavcodec/libx265: add a flag to output ROI warnings only once.
Guo, Yejun [Mon, 23 Sep 2019 02:02:35 +0000 (10:02 +0800)]
libavcodec/libx265: add a flag to output ROI warnings only once.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
5 years agolibavcodec/libx264: add a flag to output ROI warnings only once.
Guo, Yejun [Mon, 23 Sep 2019 02:02:34 +0000 (10:02 +0800)]
libavcodec/libx264: add a flag to output ROI warnings only once.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
5 years agoavcodec/utils: Optimize ff_color_frame() using memcpy()
Michael Niedermayer [Mon, 24 Dec 2018 00:14:51 +0000 (01:14 +0100)]
avcodec/utils: Optimize ff_color_frame() using memcpy()

4650975 -> 4493240 dezicycles

This optimizes lines 2 and later. Line 1 still uses av_memcpy_backptr()
This change originally fixed ossfuzz 10790 but this is now fixed by other
optimizations already

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/aacdec: Check if we run out of input in read_stream_mux_config()
Michael Niedermayer [Sun, 8 Sep 2019 19:08:31 +0000 (21:08 +0200)]
avcodec/aacdec: Check if we run out of input in read_stream_mux_config()

Fixes: Infinite loop
Fixes: 16920/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5653421289373696
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/h264_slice: clear frame only on gaps when it is not otherwise initilaized
Michael Niedermayer [Sun, 8 Sep 2019 17:27:26 +0000 (19:27 +0200)]
avcodec/h264_slice: clear frame only on gaps when it is not otherwise initilaized

Fixes: Timeout (53sec -> 31sec)
Fixes: 16908/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5711207859748864
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/utils: Use av_memcpy_backptr() in ff_color_frame()
Michael Niedermayer [Sun, 8 Sep 2019 15:25:07 +0000 (17:25 +0200)]
avcodec/utils: Use av_memcpy_backptr() in ff_color_frame()

Fixes: Timeout (191sec -> 53sec)
Fixes: 16908/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5711207859748864
Fixes: 10709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5630617975259136
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>