]> git.sesse.net Git - ffmpeg/log
ffmpeg
3 years agoavcodec/[e]ac3enc: Fix indentation
Andreas Rheinhardt [Tue, 30 Mar 2021 18:01:17 +0000 (20:01 +0200)]
avcodec/[e]ac3enc: Fix indentation

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agoavcodec/ac3enc: Avoid needlessly copying encoded packets around
Andreas Rheinhardt [Mon, 29 Mar 2021 16:54:46 +0000 (18:54 +0200)]
avcodec/ac3enc: Avoid needlessly copying encoded packets around

AC-3 and EAC-3 are codecs whose packet sizes are known in advance,
so one can use the min_size parameter of ff_alloc_packet2() to
allocate exactly this amount. This avoids a memcpy later in
av_packet_make_refcounted() in encode_simple_internal().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agoavcodec/ac3enc: Use actual size of buffer in init_put_bits()
Andreas Rheinhardt [Mon, 29 Mar 2021 16:19:43 +0000 (18:19 +0200)]
avcodec/ac3enc: Use actual size of buffer in init_put_bits()

Since the very beginning (since de6d9b6404bfd1c589799142da5a95428f146edd)
the AC-3 encoder used AC3_MAX_CODED_FRAME_SIZE (namely 3840) for the
size of the output buffer (without any check at all).
This causes problems when encoding EAC-3 for which the maximum is too small,
smaller than the actual size of the buffer: One can run into asserts used
by the PutBits API. Ticket #8513 is about such a case and this commit
fixes it by using the real size of the buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agodoc/muxers: add entry for A64 muxer
Gyan Doshi [Fri, 2 Apr 2021 06:34:56 +0000 (12:04 +0530)]
doc/muxers: add entry for A64 muxer

3 years agodoc/encoders: add entry for a64 encoders
Gyan Doshi [Fri, 2 Apr 2021 09:43:39 +0000 (15:13 +0530)]
doc/encoders: add entry for a64 encoders

3 years agoavcodec/adpcmenc: don't share a single AVClass between multiple AVCodecs.
Zane van Iperen [Thu, 1 Apr 2021 10:31:35 +0000 (20:31 +1000)]
avcodec/adpcmenc: don't share a single AVClass between multiple AVCodecs.

Temporary fix until AVClass::child_class_next is gone.

Reviewed-By: James Almer <jamrial@gmail.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agolibswscale/x86/yuv2yuvX: Removes unrolling for mmx and mmxext
Alan Kelly [Thu, 1 Apr 2021 10:00:15 +0000 (12:00 +0200)]
libswscale/x86/yuv2yuvX: Removes unrolling for mmx and mmxext

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolibswscale/x86/swscale: Only call ff_yuv2yuvX functions if the input size is > 0
Alan Kelly [Thu, 1 Apr 2021 10:00:16 +0000 (12:00 +0200)]
libswscale/x86/swscale: Only call ff_yuv2yuvX functions if the input size is > 0

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agotests/checkasm/sw_scale: adds additional tests sizes for yux2yuvX
Alan Kelly [Thu, 1 Apr 2021 10:00:17 +0000 (12:00 +0200)]
tests/checkasm/sw_scale: adds additional tests sizes for yux2yuvX

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/asf: Use ff_add_attached_pic() to read attached pics
Andreas Rheinhardt [Mon, 29 Mar 2021 07:01:50 +0000 (09:01 +0200)]
avformat/asf: Use ff_add_attached_pic() to read attached pics

Also removes a stack packet.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agoavformat/utils: Free new streams in ff_add_attached_pic on error
Andreas Rheinhardt [Mon, 29 Mar 2021 06:50:18 +0000 (08:50 +0200)]
avformat/utils: Free new streams in ff_add_attached_pic on error

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agoavformat: Add and use helper function to add attachment streams
Andreas Rheinhardt [Mon, 29 Mar 2021 05:58:56 +0000 (07:58 +0200)]
avformat: Add and use helper function to add attachment streams

All instances of adding attached pictures to a stream or adding
a stream and an attached packet to said stream have several things
in common like setting the index and flags of the packet, setting
the stream disposition etc. This commit therefore factors this out.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agoavcodec/flashsv2enc: Fix undefined NULL + 0
Andreas Rheinhardt [Fri, 26 Mar 2021 17:35:25 +0000 (18:35 +0100)]
avcodec/flashsv2enc: Fix undefined NULL + 0

Affected the vsynth*-flashsv2 FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavutil/pixdesc: Fix 1 << 32
Andreas Rheinhardt [Fri, 26 Mar 2021 17:22:24 +0000 (18:22 +0100)]
avutil/pixdesc: Fix 1 << 32

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/motion_est: Fix invalid left shift of negative numbers
Andreas Rheinhardt [Fri, 26 Mar 2021 17:18:05 +0000 (18:18 +0100)]
avcodec/motion_est: Fix invalid left shift of negative numbers

Affected many FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_codecview: Fix undefined left shifts of negative numbers
Andreas Rheinhardt [Fri, 26 Mar 2021 15:24:59 +0000 (16:24 +0100)]
avfilter/vf_codecview: Fix undefined left shifts of negative numbers

Affected the filter-codecview-mvs FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/g2meet: Fix undefined NULL + 0
Andreas Rheinhardt [Fri, 26 Mar 2021 15:17:04 +0000 (16:17 +0100)]
avcodec/g2meet: Fix undefined NULL + 0

Affected the g2m4 FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavutil/base64: Fix undefined NULL + 0
Andreas Rheinhardt [Fri, 26 Mar 2021 15:03:27 +0000 (16:03 +0100)]
avutil/base64: Fix undefined NULL + 0

Affected the base64 FATE test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/vmdvideo: Fix NULL + 0
Andreas Rheinhardt [Fri, 26 Mar 2021 14:12:10 +0000 (15:12 +0100)]
avcodec/vmdvideo: Fix NULL + 0

Affected the FATE tests filter-gradfun-sample and sierra-vmd-video.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mss12: Don't apply non-zero offset to null pointer
Andreas Rheinhardt [Fri, 26 Mar 2021 13:40:40 +0000 (14:40 +0100)]
avcodec/mss12: Don't apply non-zero offset to null pointer

Affected the FATE tests mss2-wmv and mss1-pal.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/lcldec: Fix undefined NULL + 0
Andreas Rheinhardt [Fri, 26 Mar 2021 13:11:18 +0000 (14:11 +0100)]
avcodec/lcldec: Fix undefined NULL + 0

Affected the FATE tests vsynth*-zlib, mszh and zlib.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/qtrleenc: Fix negative linesizes, don't use NULL + offset
Andreas Rheinhardt [Fri, 26 Mar 2021 12:37:43 +0000 (13:37 +0100)]
avcodec/qtrleenc: Fix negative linesizes, don't use NULL + offset

Before commit f1e17eb446577180ee9976730aacb46563766518, the qtrle
encoder had undefined pointer arithmetic: Outside of a loop, two
pointers were set to point to the ith element (with index i-1) of
a line of a frame. At the end of each loop iteration, these pointers
were decremented, so that they pointed to the -1th element of the line
after the loop. Furthermore, one of these pointers can be NULL (in which
case all pointer arithmetic is automatically undefined behaviour).

Commit f1e17eb44 added a check in order to ensure that the elements
never point to the -1th element of the array: The pointers are only
decremented if they are bigger than the frame's base pointer
(i.e. AVFrame.data[0]). Yet this check does not work at all in case of
negative linesizes; furthermore in case the pointer that can be NULL is
NULL initializing it still involves undefined pointer arithmetic.

This commit fixes both of these issues: First, non-NULL pointers are
initialized to point to the element after the ith element and
decrementing is moved to the beginning of the loop. Second, if a pointer
is NULL, it is just made to point to the other pointer, as this allows
to avoid checks before decrementing it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/qtrleenc: Use keyframe when no previous frame is available
Andreas Rheinhardt [Fri, 26 Mar 2021 11:42:21 +0000 (12:42 +0100)]
avcodec/qtrleenc: Use keyframe when no previous frame is available

If keeping a reference to an earlier frame failed, the next frame must
be an I frame for lack of reference frame. This commit implements this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agolibswresample/audioconvert: Fix undefined NULL + 0
Andreas Rheinhardt [Fri, 26 Mar 2021 08:43:22 +0000 (09:43 +0100)]
libswresample/audioconvert: Fix undefined NULL + 0

Affected 26 FATE tests like swr-resample_async-s16p-44100-8000.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/proresdec2: Don't apply non-zero offset to null pointer
Andreas Rheinhardt [Fri, 26 Mar 2021 08:21:22 +0000 (09:21 +0100)]
avcodec/proresdec2: Don't apply non-zero offset to null pointer

Affected ProRes without alpha; affected 32 FATE tests, e.g. prores-422,
prores-422_proxy, prores-422_lt or matroska-prores-header-insertion-bz2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mpegvideo_enc: Don't apply non-zero offset to null pointer
Andreas Rheinhardt [Fri, 26 Mar 2021 06:15:56 +0000 (07:15 +0100)]
avcodec/mpegvideo_enc: Don't apply non-zero offset to null pointer

Affected many FATE tests (mostly vsynth ones).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/af_hdcd: Fix undefined shifts
Andreas Rheinhardt [Fri, 26 Mar 2021 05:22:24 +0000 (06:22 +0100)]
avfilter/af_hdcd: Fix undefined shifts

Affected the filter-hdcd-* FATE tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dcaenc: Fix undefined left shift of negative numbers
Andreas Rheinhardt [Fri, 26 Mar 2021 05:03:49 +0000 (06:03 +0100)]
avcodec/dcaenc: Fix undefined left shift of negative numbers

Affected the acodec-dca and acodec-dca2 FATE tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agotests/matroska: Add test for remuxing annex B H.264 into Matroska
Andreas Rheinhardt [Wed, 31 Mar 2021 18:25:04 +0000 (20:25 +0200)]
tests/matroska: Add test for remuxing annex B H.264 into Matroska

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agoavcodec/pnm_parser: Check image size addition for overflow
Michael Niedermayer [Tue, 30 Mar 2021 11:22:14 +0000 (13:22 +0200)]
avcodec/pnm_parser: Check image size addition for overflow

Fixes: assertion failure
Fixes: out of array access
Fixes: 32664/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-6533642202513408.fuzz
Fixes: 32669/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-6001928875147264
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/lscrdec: Check length in decode_idat()
Michael Niedermayer [Tue, 30 Mar 2021 11:17:09 +0000 (13:17 +0200)]
avcodec/lscrdec: Check length in decode_idat()

Fixes: out of array access
Fixes: 32264/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LSCR_fuzzer-6684504010915840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agotools/target_dem_fuzzer: Fix packet leak
Michael Niedermayer [Mon, 22 Mar 2021 20:58:30 +0000 (21:58 +0100)]
tools/target_dem_fuzzer: Fix packet leak

Fixes: 32121/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-4512973109460992
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/imx: Check palette chunk size
Michael Niedermayer [Tue, 30 Mar 2021 10:47:22 +0000 (12:47 +0200)]
avformat/imx: Check palette chunk size

Fixes: out of array write
Fixes: 32116/clusterfuzz-testcase-minimized-ffmpeg_dem_SIMBIOSIS_IMX_fuzzer-6702533894602752
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h265_metadata_bsf: Check nb_units before accessing the first in h265_metadata...
Michael Niedermayer [Tue, 30 Mar 2021 10:36:08 +0000 (12:36 +0200)]
avcodec/h265_metadata_bsf: Check nb_units before accessing the first in h265_metadata_update_fragment()

Fixes: null pointer dereference
Fixes: 32113/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-4803262287052800
Same as 0c48c332eeb2866d9353125f701e099c48889463

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/rmdec: use larger intermediate type for audio_framesize * sub_packet_h check
Michael Niedermayer [Tue, 30 Mar 2021 09:03:56 +0000 (11:03 +0200)]
avformat/rmdec: use larger intermediate type for audio_framesize * sub_packet_h check

Fixes: signed integer overflow: 65535 * 65535 cannot be represented in type 'int'
Fixes: 31406/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-5024692843970560
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/exr: Check oe in huf_decode() before use
Michael Niedermayer [Tue, 30 Mar 2021 07:15:27 +0000 (09:15 +0200)]
avcodec/exr: Check oe in huf_decode() before use

Fixes: out of array access
Fixes: 31386/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5773234709594112
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agotls_gnutls: Print the underlying IO error message and pass the error code through
Martin Storsjö [Fri, 26 Mar 2021 13:41:07 +0000 (15:41 +0200)]
tls_gnutls: Print the underlying IO error message and pass the error code through

Signed-off-by: Martin Storsjö <martin@martin.st>
3 years agotls_openssl: Improve quality of printed error messages, pass IO error codes through
Martin Storsjö [Fri, 26 Mar 2021 13:39:53 +0000 (15:39 +0200)]
tls_openssl: Improve quality of printed error messages, pass IO error codes through

Print every error in the stack, if more than one, and don't print
bogus errors if there's none logged within OpenSSL.

Retain the underlying IO error code, print an error message out of
it, and pass the error code on to the caller.

Signed-off-by: Martin Storsjö <martin@martin.st>
3 years agortpenc_mpegts: add AVClass to the muxer context
Gyan Doshi [Wed, 31 Mar 2021 13:10:48 +0000 (18:40 +0530)]
rtpenc_mpegts: add AVClass to the muxer context

3 years agoavcodec/h264_slice: Check input SPS in ff_h264_update_thread_context()
Michael Niedermayer [Sat, 20 Mar 2021 13:36:28 +0000 (14:36 +0100)]
avcodec/h264_slice: Check input SPS in ff_h264_update_thread_context()

Fixes: crash
Fixes: check_pkt.mp4
Found-by: Rafael Dutra <rafael.dutra@cispa.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpegpicture: Keep ff_mpeg_framesize_alloc() failure state consistent
Michael Niedermayer [Thu, 18 Mar 2021 18:19:54 +0000 (19:19 +0100)]
avcodec/mpegpicture: Keep ff_mpeg_framesize_alloc() failure state consistent

Fixes: null pointer dereference
Fixes: ff_put_pixels16_sse2.mp4
Found-by: Rafael Dutra <rafael.dutra@cispa.de>
Regression-since: 4b2863ff01b1fe93d9a518523c9098d17a9d8c6f
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mpc8: check for size overflow in mpc8_get_chunk_header()
Michael Niedermayer [Wed, 17 Mar 2021 20:58:53 +0000 (21:58 +0100)]
avformat/mpc8: check for size overflow in mpc8_get_chunk_header()

Fixes: signed integer overflow: -9223372036854775760 - 50 cannot be represented in type 'long'
Fixes: 31673/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-580134751869337
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mov: Do not zero memory that is written too or unused
Michael Niedermayer [Sun, 21 Mar 2021 17:08:43 +0000 (18:08 +0100)]
avformat/mov: Do not zero memory that is written too or unused

Fixes: OOM
Fixes: 31220/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6033383962574848
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpegvideo: Update chroma_?_shift in ff_mpv_common_frame_size_change()
Michael Niedermayer [Mon, 22 Mar 2021 14:22:35 +0000 (15:22 +0100)]
avcodec/mpegvideo: Update chroma_?_shift in ff_mpv_common_frame_size_change()

Fixes: out of array access
Fixes: 31201/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-4627865612189696.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mov: Ignore multiple STSC / STCO
Michael Niedermayer [Wed, 24 Mar 2021 16:03:08 +0000 (17:03 +0100)]
avformat/mov: Ignore multiple STSC / STCO

Fixes: STSC / STCO inconsistency and assertion failure
Fixes: crbug1184666.mp4
Found-by: Chromium ASAN fuzzer
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: Extend overflow check in dts wrap in compute_pkt_fields()
Michael Niedermayer [Tue, 2 Feb 2021 16:29:23 +0000 (17:29 +0100)]
avformat/utils: Extend overflow check in dts wrap in compute_pkt_fields()

Fixes: signed integer overflow: -9223372032574480351 - 4294967296 cannot be represented in type 'long long'
Fixes: 30022/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5568610275819520
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/vf_scale: Fix adding 0 to NULL (which is UB) in scale_slice()
Michael Niedermayer [Fri, 19 Feb 2021 20:43:45 +0000 (21:43 +0100)]
avfilter/vf_scale: Fix adding 0 to NULL (which is UB) in scale_slice()

Found-by: Jeremy Leconte <jleconte@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavutil/common: Add FF_PTR_ADD()
Michael Niedermayer [Mon, 15 Mar 2021 08:47:43 +0000 (09:47 +0100)]
avutil/common: Add FF_PTR_ADD()

Suggested-by: Andreas Rheinhardt
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/asf: Factor common code out
Andreas Rheinhardt [Mon, 29 Mar 2021 06:31:36 +0000 (08:31 +0200)]
avformat/asf: Factor common code out

Both functions to read attached pictures coincide since
e83f27a21a6d2f602b55e541ef66e365400e9827 (save for some log messages
in case av_dict_set failed).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agoavcodec/mjpegenc: Fix segfault when freeing incomplete context
Andreas Rheinhardt [Tue, 30 Mar 2021 21:20:49 +0000 (23:20 +0200)]
avcodec/mjpegenc: Fix segfault when freeing incomplete context

When allocating the MJpegContext fails (or if the dimensions run afoul
of the 65500x65500 limit), an attempt to free a subbuffer of said
context leads to a segfault in ff_mjpeg_encode_close().
Seems to be a regression since 467d9e27e0cb2bf74f41dc832f2f8d191ba58ec9.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agoavcodec/tiff: Avoid forward declarations
Andreas Rheinhardt [Tue, 30 Mar 2021 05:53:50 +0000 (07:53 +0200)]
avcodec/tiff: Avoid forward declarations

In this case it also fixes a potential for compilation failures:
Not all compilers can handle the case in which a function with
a forward declaration declared with an attribute to always inline it
is called before the function body appears. E.g. GCC 4.2.1 on OS X 10.6
doesn't like it.

Reviewed-by: Pavel Koshevoy <pkoshevoy@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agotests/matroska: Add test for WebVTT in WebM
Andreas Rheinhardt [Mon, 29 Mar 2021 13:09:26 +0000 (15:09 +0200)]
tests/matroska: Add test for WebVTT in WebM

Specifically test that the WebVTT flavour is correctly mapped to
the Matroska/WebM CodecID and back; and test that dispositions
unsupported by WebM are discarded even when they would be supported
by Matroska.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agofftools/ffprobe: Add missing dispositions
Andreas Rheinhardt [Mon, 29 Mar 2021 12:18:47 +0000 (14:18 +0200)]
fftools/ffprobe: Add missing dispositions

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years agodoc/demuxers: note support for flv variant KUX
Gyan Doshi [Wed, 31 Mar 2021 09:46:12 +0000 (15:16 +0530)]
doc/demuxers: note support for flv variant KUX

3 years agoavcodec/dv_profile: PAL DV files with dsf flag 0 - detect via pal flag and buf_size
Mark Plomer [Thu, 18 Mar 2021 12:19:16 +0000 (13:19 +0100)]
avcodec/dv_profile: PAL DV files with dsf flag 0 - detect via pal flag and buf_size

Some old DV AVI files have the DSF-Flag of frames set to 0, although it
is PAL (maybe rendered with an old Ulead Media Studio Pro) ... this causes
ffmpeg/VLC-player to produce/play corrupted video (other players/editors
like VirtualDub work fine).

Fixes ticket #8333 and replaces/extends hack for ticket #2177

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/rtpdec: Fix prft wallclock time.
Alok Priyadarshi [Thu, 25 Mar 2021 04:46:36 +0000 (21:46 -0700)]
avformat/rtpdec: Fix prft wallclock time.

Timestamp difference is available in media timebase (1/90K) where as
rtcp time is in the default microseconds timebase. This patch fixes
the calculated prft wallclock time by rescaling the timestamp delta
to the microseconds timebase.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/put_bits: Don't set size_in_bits, fix overflow
Andreas Rheinhardt [Thu, 25 Mar 2021 13:17:10 +0000 (14:17 +0100)]
avcodec/put_bits: Don't set size_in_bits, fix overflow

A PutBitContext has a field called size_in_bits which is set to the
context's bitsize init_put_bits(); but it isn't used at all (the PutBits
API uses pointers directly and not bit indexes), so remove it (due to
ABI concerns the actual element is only removed at the next bump).

Furthermore, the multiplication inherent in setting this field can lead
to undefined integer overflows. This is particularly true for FFV1,
which uses a very big worst-case buffer (37*4*width*height; even
ordinary 1080p triggers an overflow). Ticket #8350 is about this
overflow which this commit fixes.

This means that the effective range of the PutBits API is no longer
restricted by the /8 as long as one isn't using put_bits_(count|left).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoAvoid intermediate bitcount for number of bytes in PutBitContext
Andreas Rheinhardt [Thu, 25 Mar 2021 11:52:56 +0000 (12:52 +0100)]
Avoid intermediate bitcount for number of bytes in PutBitContext

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dvenc: Avoid using PutBitContext fields directly
Andreas Rheinhardt [Thu, 25 Mar 2021 11:28:54 +0000 (12:28 +0100)]
avcodec/dvenc: Avoid using PutBitContext fields directly

Also avoid using bitcounts in case one is actually byte-aligned.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/proresenc_kostya: Factor flushing PutBitContext out
Andreas Rheinhardt [Thu, 25 Mar 2021 10:30:06 +0000 (11:30 +0100)]
avcodec/proresenc_kostya: Factor flushing PutBitContext out

The function to write an ordinary (luma or chroma) plane as well as
the function for writing an alpha plane have some similarities:
They record the initial bitposition (despite said position always being
byte-aligned), flush the PutBitContext themselves and return the amount
of bytes they wrote.

This commit factors this out; it also replaces bitpositions by
bytepositions and it avoids recording the initial byteposition because
said information is already available from the position at the end of
the last plane.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/utvideoenc: Don't use bitcounts when byte-aligned
Andreas Rheinhardt [Thu, 25 Mar 2021 09:38:12 +0000 (10:38 +0100)]
avcodec/utvideoenc: Don't use bitcounts when byte-aligned

Despite write_huff_codes() receiving an ordinary buffer (not a
PutBitContext), it returned the amount of data written in bits,
not in bytes. This has been changed: There is now no intermediate
bitcount any more.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec: Remove cumbersome way of checking for amount of bytes left
Andreas Rheinhardt [Thu, 25 Mar 2021 09:27:31 +0000 (10:27 +0100)]
avcodec: Remove cumbersome way of checking for amount of bytes left

Several encoders used code like the following to check for the amount of
bytes left in a PutBitContext:
pb->buf_end - pb->buf - (put_bits_count(pb) >> 3)
Besides the fact that using the pointers directly might pose
a maintainence burden in the future this also leads to suboptimal code:
The above code reads all three pointers (buf, buf_ptr and buf_end), but
touching buf is unnecessary and switching to put_bytes_left()
automatically fixes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/put_bits: Add functions for amount of bytes written/left
Andreas Rheinhardt [Thu, 25 Mar 2021 08:05:49 +0000 (09:05 +0100)]
avcodec/put_bits: Add functions for amount of bytes written/left

Often a caller doesn't want the amount of bits written via a
PutBitContext, but the amount of bytes. This in particular happens
after one has flushed the PutBitContext (e.g. at the end of encoding,
when one wants to know the actual packet size). The current way of doing
this is with put_bits_count(pb)/8 (or (put_bits_count(pb) + 7)/8).

Yet this has some issues: It contains implicit multiplications and
divisions by 8 with a cast in between; it obscurs the intent; and
it restricts the size of the buffer to (currently) INT_MAX/8 (or
to 1/8 of the maximum of whatever put_bits_count() returns), although
said restriction is not really necessary for users that don't need
a bitcount.

Corresponding functions for the amount of bytes left have also been
addded.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/vorbisenc, wmavoice: Use put_bits_left() where appropriate
Andreas Rheinhardt [Thu, 25 Mar 2021 05:07:37 +0000 (06:07 +0100)]
avcodec/vorbisenc, wmavoice: Use put_bits_left() where appropriate

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dvenc: Remove dead error message
Andreas Rheinhardt [Thu, 25 Mar 2021 04:36:22 +0000 (05:36 +0100)]
avcodec/dvenc: Remove dead error message

The PutBits API checks the available space before every write,
so this check for overread is dead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mlpenc: Avoid redundant temporary PutBitContext
Andreas Rheinhardt [Thu, 25 Mar 2021 01:55:53 +0000 (02:55 +0100)]
avcodec/mlpenc: Avoid redundant temporary PutBitContext

We are already word-aligned here, so one can just as well flush the main
PutBitContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/sonic: Remove outdated outcommented line
Andreas Rheinhardt [Thu, 25 Mar 2021 01:28:45 +0000 (02:28 +0100)]
avcodec/sonic: Remove outdated outcommented line

Compilation would fail if it were outcommented as it refers to a
nonexistent PutBitContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/vorbisenc: Remove always-false check
Andreas Rheinhardt [Wed, 24 Mar 2021 23:59:42 +0000 (00:59 +0100)]
avcodec/vorbisenc: Remove always-false check

The PutBitContext is big enough: It has just been initialized to 8192B.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/setts_bsf: Check timebase
Michael Niedermayer [Thu, 4 Mar 2021 12:06:22 +0000 (13:06 +0100)]
avcodec/setts_bsf: Check timebase

Fixes: Division by 0
Fixes: 30952/clusterfuzz-testcase-minimized-ffmpeg_BSF_SETTS_fuzzer-6601016202100736
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/wtvdec: Check size in SBE2_STREAM_DESC_EVENT / stream2_guid
Michael Niedermayer [Wed, 3 Mar 2021 23:30:45 +0000 (00:30 +0100)]
avformat/wtvdec: Check size in SBE2_STREAM_DESC_EVENT / stream2_guid

Fixes: signed integer overflow: 539033600 - -1910497124 cannot be represented in type 'int'
Fixes: 30928/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-5922630966312960
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: Fix integer overflow with duration_gcd in ff_rfps_calculate()
Michael Niedermayer [Wed, 3 Mar 2021 23:15:53 +0000 (00:15 +0100)]
avformat/utils: Fix integer overflow with duration_gcd in ff_rfps_calculate()

Fixes: signed integer overflow: 136323327 * 281474976710656 cannot be represented in type 'long'
Fixes: 30913/clusterfuzz-testcase-minimized-ffmpeg_dem_IVF_fuzzer-5753392189931520
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/dvbsubdec: Support computing clut only once
Michael Niedermayer [Thu, 4 Mar 2021 13:22:31 +0000 (14:22 +0100)]
avcodec/dvbsubdec: Support computing clut only once

This avoids crafted files from consuming excessive resources recomputing the clut after each pixel change

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agotools/target_dec_fuzzer: Adjust threshold for H264
Michael Niedermayer [Thu, 4 Mar 2021 17:59:20 +0000 (18:59 +0100)]
tools/target_dec_fuzzer: Adjust threshold for H264

Fixes: Timeout (too long -> 3sec)
Fixes: 28047/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-4662727980875776
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agotools/target_dec_fuzzer: Compute CLUT for DVBSUB only once
Michael Niedermayer [Thu, 4 Mar 2021 13:24:03 +0000 (14:24 +0100)]
tools/target_dec_fuzzer: Compute CLUT for DVBSUB only once

Fixes: Timeout
Fixes: 30845/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVBSUB_fuzzer-5744263725973504
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/cafdec: Do not build an index if all packets are the same
Michael Niedermayer [Thu, 4 Mar 2021 18:21:35 +0000 (19:21 +0100)]
avformat/cafdec: Do not build an index if all packets are the same

Fixes: Timeout
Fixes: 28214/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6495999421579264
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/sierravmd: Make struct smaller by reordering
Andreas Rheinhardt [Wed, 24 Mar 2021 01:17:35 +0000 (02:17 +0100)]
avformat/sierravmd: Make struct smaller by reordering

Also remove keyframe from vmd_frame, it is unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/sierravmd: Remove outdated check
Andreas Rheinhardt [Wed, 24 Mar 2021 00:39:50 +0000 (01:39 +0100)]
avformat/sierravmd: Remove outdated check

The check has been added at a time when the code performed the
multiplication itself instead of deferring it to av_malloc_array()
and when our allocation functions used unsigned instead of size_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/segafilm: Remove outdated check
Andreas Rheinhardt [Wed, 24 Mar 2021 00:21:41 +0000 (01:21 +0100)]
avformat/segafilm: Remove outdated check

The check has been added at a time when the code performed the
multiplication itself instead of deferring it to av_malloc_array()
and when our allocation functions used unsigned instead of size_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/utils: Remove redundant check
Andreas Rheinhardt [Wed, 24 Mar 2021 00:14:24 +0000 (01:14 +0100)]
avformat/utils: Remove redundant check

This check is outdated because the caller doesn't need to check that
the multiplication overflows when using av_realloc_array() (the code
in question used av_realloc() before that); furthermore, the check
is also a remnant of the time in which our allocation functions
didn't use size_t parameters.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_paletteuse: Fix left shift outside of range of int
Andreas Rheinhardt [Wed, 22 Jan 2020 00:47:21 +0000 (01:47 +0100)]
avfilter/vf_paletteuse: Fix left shift outside of range of int

by keeping the variable uint32_t which in this situation is the natural
type anyway. This affected the FATE-test filter-paletteuse-sierra2_4a.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/asrc_sine: Fix invalid left shift of negative number
Andreas Rheinhardt [Wed, 22 Jan 2020 01:05:10 +0000 (02:05 +0100)]
avfilter/asrc_sine: Fix invalid left shift of negative number

by using a multiplication instead. The multiplication can never overflow
an int because the sin-factor is only an int16_t.

Affected the FATE-tests filter-concat and filter-concat-vfr.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/webmdashenc: Don't pass NULL to memcmp
Andreas Rheinhardt [Mon, 23 Sep 2019 21:23:10 +0000 (23:23 +0200)]
avformat/webmdashenc: Don't pass NULL to memcmp

Affects the FATE-tests webm-dash-manifest-unaligned-video-streams,
webm-dash-manifest and webm-dash-manifest-representations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/vividas: Use equals check with n in read_sb_block()
Michael Niedermayer [Mon, 15 Feb 2021 20:29:11 +0000 (21:29 +0100)]
avformat/vividas: Use equals check with n in read_sb_block()

Fixes: OOM
Fixes: 27780/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5097985075314688
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/sonic: Use unsigned temporary in predictor_calc_error()
Michael Niedermayer [Wed, 10 Feb 2021 22:05:17 +0000 (23:05 +0100)]
avcodec/sonic: Use unsigned temporary in predictor_calc_error()

Fixes: signed integer overflow: -2147471366 - 18638 cannot be represented in type 'int'
Fixes: 30157/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5171199746506752
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/jacosubdec: Use 64bit intermediate for start/end timestamp shift
Michael Niedermayer [Thu, 11 Feb 2021 21:44:36 +0000 (22:44 +0100)]
avformat/jacosubdec: Use 64bit intermediate for start/end timestamp shift

Fixes: signed integer overflow: -1957694447 + -1620425806 cannot be represented in type 'int'
Fixes: 30207/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5050791771635712
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/flvdec: Check array entry number
Michael Niedermayer [Thu, 11 Feb 2021 21:58:53 +0000 (22:58 +0100)]
avformat/flvdec: Check array entry number

Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
Fixes: 30209/clusterfuzz-testcase-minimized-ffmpeg_dem_FLV_fuzzer-5724831658147840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/rtpenc_mpegts: stop leaks
Gyan Doshi [Sun, 28 Mar 2021 09:35:37 +0000 (15:05 +0530)]
avformat/rtpenc_mpegts: stop leaks

Fixes CID 1474460 & 1474461

3 years agodoc/filters: note default for elbg pal8 option
Gyan Doshi [Sun, 28 Mar 2021 09:56:56 +0000 (15:26 +0530)]
doc/filters: note default for elbg pal8 option

3 years agoavcodec/libxvid: remove unnecessary output packet data check
James Almer [Fri, 19 Mar 2021 01:45:12 +0000 (22:45 -0300)]
avcodec/libxvid: remove unnecessary output packet data check

The user buffers passed to avcodec_encode_video2() haven't been propagated to
AVCodec.encode2 implementations since 93016f5d1d280f9cb7856883af287fa66affc04c.
Also, the generic encode code already unrefs the packet if nothing was encoded.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/mov: Properly forward error codes from av_seek
Derek Buitenhuis [Thu, 25 Mar 2021 16:29:16 +0000 (16:29 +0000)]
avformat/mov: Properly forward error codes from av_seek

This is important, for example, for connection timed out events,
when used over a network, returning AVERROR(ETIMEDOUT).

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agotools/target_dec_fuzzer: Adjust threshold for flac
Michael Niedermayer [Mon, 22 Mar 2021 19:51:43 +0000 (20:51 +0100)]
tools/target_dec_fuzzer: Adjust threshold for flac

Fixes: Timeout
Fixes: 31464/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-4843965653319680
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h264_slice: Check sps in h264_slice_header_init()
Michael Niedermayer [Sat, 20 Mar 2021 16:02:36 +0000 (17:02 +0100)]
avcodec/h264_slice: Check sps in h264_slice_header_init()

Fixes: null pointer dereference
Fixes: h264_slice_header_init.mp4
Found-by: Rafael Dutra <rafael.dutra@cispa.de>
Tested-by: Rafael Dutra <rafael.dutra@cispa.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/aacpsy: Check model_priv_data before dereferencing in psy_3gpp_end()
Michael Niedermayer [Thu, 18 Mar 2021 21:20:03 +0000 (22:20 +0100)]
avcodec/aacpsy: Check model_priv_data before dereferencing in psy_3gpp_end()

Fixes: null pointer dereference
Fixes: av_freep.mp4
Found-by: Rafael Dutra <rafael.dutra@cispa.de>
Tested-by: Rafael Dutra <rafael.dutra@cispa.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/movenc: Avoid loosing cluster array on failure
Michael Niedermayer [Thu, 18 Mar 2021 17:01:52 +0000 (18:01 +0100)]
avformat/movenc: Avoid loosing cluster array on failure

Fixes: crash
Fixes: check_pkt.mp4
Found-by: Rafael Dutra <rafael.dutra@cispa.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agotools/target_dec_fuzzer: Adjust VP4 threshold
Michael Niedermayer [Thu, 18 Mar 2021 10:03:19 +0000 (11:03 +0100)]
tools/target_dec_fuzzer: Adjust VP4 threshold

Fixes: Timeout (>10sec -> <100ms)
Fixes: 31515/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP4_fuzzer-5247114134290432
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/avidec: Check for dv streams before using priv_data in parse ##dc/##wb
Michael Niedermayer [Thu, 18 Mar 2021 09:59:19 +0000 (10:59 +0100)]
avformat/avidec: Check for dv streams before using priv_data in parse ##dc/##wb

Fixes: null pointer dereference
Fixes: 31588/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-6165716135968768
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mov: Check sample size for overflow in mov_parse_stsd_audio()
Michael Niedermayer [Wed, 17 Mar 2021 22:39:04 +0000 (23:39 +0100)]
avformat/mov: Check sample size for overflow in mov_parse_stsd_audio()

Fixes: signed integer overflow: 2 * 1914708000 cannot be represented in type 'int'
Fixes: 31639/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6303428239294464
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/sga: Check for array end in lzss_decompress()
Michael Niedermayer [Wed, 17 Mar 2021 21:19:33 +0000 (22:19 +0100)]
avcodec/sga: Check for array end in lzss_decompress()

Fixes: out of array access
Fixes: 31640/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SGA_fuzzer-5630883286614016
Fixes: 31619/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SGA_fuzzer-5176667708456960
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/sbgdec: Check for overflow in last loop in expand_timestamps()
Michael Niedermayer [Fri, 5 Mar 2021 23:10:05 +0000 (00:10 +0100)]
avformat/sbgdec: Check for overflow in last loop in expand_timestamps()

Fixes: signed integer overflow: 9223372036854775807 + 86400000000 cannot be represented in type 'long'
Fixes: 31003/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6256298771480576
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/ffwavesynth: Avoid signed integer overflow in phi_at()
Michael Niedermayer [Fri, 5 Mar 2021 19:27:50 +0000 (20:27 +0100)]
avcodec/ffwavesynth: Avoid signed integer overflow in phi_at()

Fixes: signed integer overflow: 2314885530818453536 - -9070214327174160352 cannot be represented in type 'long'
Fixes: 31000/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-6558389742206976
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>