]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoavformat/samidec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:21:46 +0000 (03:21 +0200)]
avformat/samidec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle
or when creating extradata.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/pjsdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:21:03 +0000 (03:21 +0200)]
avformat/pjsdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mpsubdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:20:09 +0000 (03:20 +0200)]
avformat/mpsubdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon creating an AVStream.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mpl2dec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:19:32 +0000 (03:19 +0200)]
avformat/mpl2dec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/microdvddec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:16:15 +0000 (03:16 +0200)]
avformat/microdvddec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle
or when allocating extradata.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/lrcdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:12:00 +0000 (03:12 +0200)]
avformat/lrcdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/jacosubdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:09:08 +0000 (03:09 +0200)]
avformat/jacosubdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/assdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:07:28 +0000 (03:07 +0200)]
avformat/assdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle
or if creating the extradata failed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/aqtitledec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:04:29 +0000 (03:04 +0200)]
avformat/aqtitledec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mov: Fix memleaks upon read_header failure
Andreas Rheinhardt [Sat, 13 Jun 2020 22:37:40 +0000 (00:37 +0200)]
avformat/mov: Fix memleaks upon read_header failure

By default, a demuxer's read_close function is not called automatically
if an error happens when reading the header; instead it is up to the
demuxer to clean up after itself in this case. The mov demuxer did this
by calling its read_close function when it encountered some errors when
reading the header. Yet for other errors (mostly adding side-data to
streams) this has been forgotten, so that all the internal structures
of the demuxer leak.

This commit fixes this by making sure mov_read_close is called when
necessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/omadec: Fix memleaks upon read_header failure
Andreas Rheinhardt [Sat, 13 Jun 2020 22:24:55 +0000 (00:24 +0200)]
avformat/omadec: Fix memleaks upon read_header failure

Fixes possible leaks of id3v2 metadata as well as an AVDES struct in
case the content is encrypted and an error happens lateron.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskadec: Fix memleaks in WebM DASH manifest demuxer
Andreas Rheinhardt [Sat, 13 Jun 2020 21:58:32 +0000 (23:58 +0200)]
avformat/matroskadec: Fix memleaks in WebM DASH manifest demuxer

In certain error scenarios, the underlying Matroska demuxer was not
properly closed, causing leaks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskadec: Use right number of tracks
Andreas Rheinhardt [Fri, 30 Aug 2019 13:18:29 +0000 (15:18 +0200)]
avformat/matroskadec: Use right number of tracks

When demuxing a Matroska/WebM file, streams are added for tracks and for
attachments, so that the array containing the former can be NULL even
when the corresponding AVFormatContext has streams. So check for there
to be tracks in the MatroskaDemuxContext instead of just streams in the
AVFormatContext before dereferencing the pointer to the tracks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskadec: Fix handling gigantic durations
Andreas Rheinhardt [Tue, 3 Sep 2019 22:50:11 +0000 (00:50 +0200)]
avformat/matroskadec: Fix handling gigantic durations

matroska_parse_block currently asserts that the duration is not equal to
AV_NOPTS_VALUE, but there is nothing that actually guarantees this. It
is easy to create (spec-compliant) files which run into this assert;
so replace it and instead cap the duration to INT64_MAX, as the duration
field of an AVPacket is an int64_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskadec: Move AVBufferRef instead of copying, fix memleak
Andreas Rheinhardt [Sat, 13 Jun 2020 20:34:19 +0000 (22:34 +0200)]
avformat/matroskadec: Move AVBufferRef instead of copying, fix memleak

EBML binary elements are already made reference-counted when read;
so when populating the AVStream.attached_pic, one does not need to
allocate a new buffer for the data; instead the current code just
creates a new reference to the underlying AVBuffer. But this can be
improved even further: Just move the already existing reference.

This also fixes a memleak that happens upon error because
matroska_read_close has not been called in this scenario.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agolavdevice: Add AudioToolbox output device.
Thilo Borgmann [Mon, 15 Jun 2020 13:09:33 +0000 (15:09 +0200)]
lavdevice: Add AudioToolbox output device.

4 years agoavformat/dashenc: Add hls_master_name option
Przemysław Sobala [Wed, 10 Jun 2020 11:14:36 +0000 (13:14 +0200)]
avformat/dashenc: Add hls_master_name option

4 years agoavformat/hlsenc: Always treat numbers as decimal
Andreas Rheinhardt [Mon, 15 Jun 2020 03:09:07 +0000 (05:09 +0200)]
avformat/hlsenc: Always treat numbers as decimal

c801ab43c36e8c4f88121aa09af26c77bcbd671b caused a regression: The stream
number is now parsed with strtoll without a fixed basis; as a
consequence, the "010" in a variant stream mapping like "a:010" is now
treated as an octal number (i.e. as eight, not ten). This was not
intended and may break some scripts, so this commit restores the old
behaviour.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/iirfilter: Fix memleak
Andreas Rheinhardt [Mon, 15 Jun 2020 01:33:13 +0000 (03:33 +0200)]
avcodec/iirfilter: Fix memleak

Commit 17e88bf0df21906633a7d36d9f2aeeeb5b6d3267 created a memleak by
removing a call to ff_iir_filter_free_coeffsp on error; this has been
found by Coverity (ID 1464159). This commit fixes the memleak by
readding the call to ff_iir_filter_free_coeffsp.

Notice that this is not a simple revert, because several macros that
were used before 17e88bf0df21906633a7d36d9f2aeeeb5b6d3267 were replaced
in commit 44863b2c2d5a31d82aafa71cdbd180d6bfbed5b4 and completely removed
in 2658680df4fc606522e5f65899afb9a98b47d287.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/hevc_mp4toannexb_bsf: Check NAL size against available input
Andreas Rheinhardt [Wed, 27 May 2020 17:09:14 +0000 (19:09 +0200)]
avcodec/hevc_mp4toannexb_bsf: Check NAL size against available input

The hevc_mp4toannexb bsf does not explicitly check whether a NAL unit
is so big that it extends beyond the end of the input packet; it does so
only implicitly by using the checked version of the bytestream2 API.
But this has downsides compared to real checks: It can lead to huge
allocations (up to 2GiB) even when the input packet is just a few bytes.
And furthermore it leads to uninitialized data being output.
So add a check to error out early if it happens.

Also check directly whether there is enough data for the length field.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/h264: create user data unregistered SEI side data for H.264
Limin Wang [Thu, 11 Jun 2020 04:50:46 +0000 (12:50 +0800)]
avcodec/h264: create user data unregistered SEI side data for H.264

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavfilter/vf_showinfo: display H.26[45] user data unregistered sei message
Limin Wang [Thu, 11 Jun 2020 23:32:29 +0000 (07:32 +0800)]
avfilter/vf_showinfo: display H.26[45] user data unregistered sei message

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/hevc_sei: add support for user data unregistered SEI message
Limin Wang [Thu, 11 Jun 2020 02:25:47 +0000 (10:25 +0800)]
avcodec/hevc_sei: add support for user data unregistered SEI message

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/cbs_av1: abort when written inferred values don't match
James Almer [Thu, 11 Jun 2020 16:06:17 +0000 (13:06 -0300)]
avcodec/cbs_av1: abort when written inferred values don't match

If this happens, it's a sign of parsing issues earlier in the process, or
misuse by the calling module.

Prevents writing invalid bitstreams.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/cbs_h2645: abort when written inferred values don't match
James Almer [Thu, 11 Jun 2020 16:06:10 +0000 (13:06 -0300)]
avcodec/cbs_h2645: abort when written inferred values don't match

If this happens, it's a sign of parsing issues earlier in the process, or
misuse by the calling module.

Prevents writing invalid bitstreams.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/mxfdec: free duplicated utf16 strings
Michael Niedermayer [Sun, 14 Jun 2020 17:45:05 +0000 (19:45 +0200)]
avformat/mxfdec: free duplicated utf16 strings

Fixes: memleak
Fixes: 23415/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5124814510751744
Suggested-by: Marton Balint <cus@passwd.hu>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/4xm: Check that a video stream was created before returning packets for it
Michael Niedermayer [Sun, 14 Jun 2020 17:51:23 +0000 (19:51 +0200)]
avformat/4xm: Check that a video stream was created before returning packets for it

Fixes: assertion failure
Fixes: 23434/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5227750851084288.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/libzvbi-teletextdec: fix txt_default_region limits
Marton Balint [Mon, 8 Jun 2020 23:31:00 +0000 (01:31 +0200)]
avcodec/libzvbi-teletextdec: fix txt_default_region limits

Max region ID is 87. Also the region affects not only the G0 charset but G2 and
the national subset as well.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/ffwavesynth: Avoid undefined operation on ts overflow
Michael Niedermayer [Sat, 13 Jun 2020 19:47:03 +0000 (21:47 +0200)]
avcodec/ffwavesynth: Avoid undefined operation on ts overflow

Alternatively these conditions could be treated as errors
Fixes: 23147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5639254549200896
Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'int64_t' (aka 'long')
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/mv30: check mode_size vs. input space
Michael Niedermayer [Sat, 13 Jun 2020 14:03:14 +0000 (16:03 +0200)]
avcodec/mv30: check mode_size vs. input space

Fixes: Timeout (longer than my patience vs 1sec)
Fixes: 22984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5630021988515840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/mpeg4videodec: Fix 2 integer overflows in get_amv()
Michael Niedermayer [Thu, 11 Jun 2020 20:22:57 +0000 (22:22 +0200)]
avcodec/mpeg4videodec: Fix 2 integer overflows in get_amv()

Fixes: signed integer overflow: -144876608 * 16 cannot be represented in type 'int'
Fixes: 22782/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-6039584977977344
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/jpeg2000dec: Fix/check for multiple integer overflows
Michael Niedermayer [Thu, 11 Jun 2020 20:45:27 +0000 (22:45 +0200)]
avcodec/jpeg2000dec: Fix/check for multiple integer overflows

Fixes: shift exponent 35 is too large for 32-bit type 'int'
Fixes: 22857/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5202709358837760
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/utils: Print analyze duration and probesize when printing a suggestion to...
Michael Niedermayer [Mon, 8 Jun 2020 09:07:27 +0000 (11:07 +0200)]
avformat/utils: Print analyze duration and probesize when printing a suggestion to increase them

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/lossless_audiodsp: Fix undefined overflows in scalarproduct_and_madd_int16_c()
Michael Niedermayer [Sun, 7 Jun 2020 17:24:10 +0000 (19:24 +0200)]
avcodec/lossless_audiodsp: Fix undefined overflows in scalarproduct_and_madd_int16_c()

Fixes: signed integer overflow: 2142077091 + 6881070 cannot be represented in type 'int'
Fixes: 22737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5958388889681920
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/sonic: Fix several integer state overflows
Michael Niedermayer [Sun, 10 May 2020 19:09:45 +0000 (21:09 +0200)]
avcodec/sonic: Fix several integer state overflows

Fixes: signed integer overflow: -234 * -14797801 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5695924975435776
Fixes: 22275/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5695924975435776
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/sonic: Fix several integer overflows
Michael Niedermayer [Thu, 20 Feb 2020 18:56:39 +0000 (19:56 +0100)]
avcodec/sonic: Fix several integer overflows

Fixes: signed integer overflow: 2129689466 + 2129689466 cannot be represented in type 'int'
Fixes: 20715/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5155263109922816
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/oggdec: Disable mid stream codec changes
Michael Niedermayer [Sat, 13 Jun 2020 10:36:49 +0000 (12:36 +0200)]
avformat/oggdec: Disable mid stream codec changes

Fixes: 22082/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5688619118624768
Fixes: crash from V-codecs/Theora/theora_testsuite_broken/multi2.ogg
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Suggested-by: Lynne on IRC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/mpeg4videodec: avoid invalid values and reinitialize in format changes for...
Michael Niedermayer [Sat, 13 Jun 2020 09:56:01 +0000 (11:56 +0200)]
avcodec/mpeg4videodec: avoid invalid values and reinitialize in format changes for studio profile

Fixes: out of array access
Fixes: 23327/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5134822992510976
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/pixlet: Fix log(0) check
Michael Niedermayer [Sat, 13 Jun 2020 09:21:52 +0000 (11:21 +0200)]
avcodec/pixlet: Fix log(0) check

Fixes: passing zero to clz(), which is not a valid argument
Fixes: 23337/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PIXLET_fuzzer-5179131989065728
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/ape: Cleanup after ape_read_header() failure
Michael Niedermayer [Sat, 13 Jun 2020 09:13:21 +0000 (11:13 +0200)]
avformat/ape: Cleanup after ape_read_header() failure

Fixes: memleaks
Fixes: 23306/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5635436931448832
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/iff: Fix off by x error
Michael Niedermayer [Sat, 13 Jun 2020 08:48:14 +0000 (10:48 +0200)]
avcodec/iff: Fix off by x error

Fixes: out of array access
Fixes: 23245/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5723121327013888.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoswscale: cosmetic fixes
Nelson Gomez [Sun, 26 Apr 2020 02:37:03 +0000 (19:37 -0700)]
swscale: cosmetic fixes

Signed-off-by: Nelson Gomez <nelson.gomez@microsoft.com>
4 years agoswscale/x86/output: add AVX2 version of yuv2nv12cX
Nelson Gomez [Sun, 26 Apr 2020 02:37:02 +0000 (19:37 -0700)]
swscale/x86/output: add AVX2 version of yuv2nv12cX

256 bits is just wide enough to fit all the operands needed to vectorize
the software implementation, but AVX2 is needed to for a couple of
instructions like cross-lane permutation.

Output is bit-for-bit identical to C.

Signed-off-by: Nelson Gomez <nelson.gomez@microsoft.com>
4 years agoswscale: make yuv2interleavedX more asm-friendly
Nelson Gomez [Sun, 26 Apr 2020 02:37:01 +0000 (19:37 -0700)]
swscale: make yuv2interleavedX more asm-friendly

Extracting information from SwsContext in assembly is difficult, and
rearranging SwsContext just for asm access didn't look good. These
functions only need a couple of fields from it anyway, so just make
them parameters in their own right.

Signed-off-by: Nelson Gomez <nelson.gomez@microsoft.com>
4 years agoavcodec/smvjpegdec: remove uninitialized ret
Limin Wang [Fri, 12 Jun 2020 23:50:22 +0000 (07:50 +0800)]
avcodec/smvjpegdec: remove uninitialized ret

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/mpegvideo: remove extra space
Limin Wang [Fri, 12 Jun 2020 23:47:13 +0000 (07:47 +0800)]
avcodec/mpegvideo: remove extra space

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoswscale/utils: return better error code from initFilter()
Limin Wang [Sat, 13 Jun 2020 05:52:20 +0000 (13:52 +0800)]
swscale/utils: return better error code from initFilter()

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoswscale/utils: reindent
Limin Wang [Fri, 12 Jun 2020 23:29:43 +0000 (07:29 +0800)]
swscale/utils: reindent

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agolavf/prompeg: prompeg_write() must report data all was written
David Holroyd [Tue, 9 Jun 2020 13:37:10 +0000 (21:37 +0800)]
lavf/prompeg: prompeg_write() must report data all was written

Previously, prompeg_write() would only report to caller that bytes we
written when a FEC packet was actually created.  Not all RTP packets are
expected to generate a FEC packet however, so this behavior was causing
avio to retry writing the RTP packet, eventually forcing the FEC state
machine to send a FEC packet erroneously (and so breaking out of the
retry loop).

This was resulting in incorrect FEC data being generated, and far too
many FEC packets to be sent (~100% FEC overhead).

fix #7863

Signed-off-by: David Holroyd <david.holroyd@m2amedia.tv>
4 years agolavu/internal: Fix comment for avpriv_dict_set_timestamp
Jun Zhao [Sat, 6 Jun 2020 09:04:58 +0000 (17:04 +0800)]
lavu/internal: Fix comment for avpriv_dict_set_timestamp

Fix comment for avpriv_dict_set_timestamp from b72a7b96f84

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavc/qsv: fix make checkheaders warning
Jun Zhao [Sun, 31 May 2020 08:12:36 +0000 (16:12 +0800)]
lavc/qsv: fix make checkheaders warning

make checkheaders will get warning as follow:

In file included from libavcodec/qsv_internal.h.c:1:
./libavcodec/qsv_internal.h:24:5: warning: "CONFIG_VAAPI" is not defined, evaluates to 0 [-Wundef]
   24 | #if CONFIG_VAAPI
      |     ^~~~~~~~~~~~

include "config.h" to fix the warning

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavformat/sccdec: move pos variables outside of loop
Paul B Mahol [Sat, 13 Jun 2020 10:23:29 +0000 (12:23 +0200)]
avformat/sccdec: move pos variables outside of loop

Ensures that sub->pos is always correct.

4 years agoavcodec/ccaption_dec: switch active screen in end of caption early
Paul B Mahol [Sat, 13 Jun 2020 09:57:33 +0000 (11:57 +0200)]
avcodec/ccaption_dec: switch active screen in end of caption early

Fixes dropping of last caption.

4 years agoavcodec/ccaption_dec: remove unused arguments from function
Paul B Mahol [Sat, 13 Jun 2020 09:48:43 +0000 (11:48 +0200)]
avcodec/ccaption_dec: remove unused arguments from function

4 years agoavcodec/ccaption_dec: check for error codes
Paul B Mahol [Sat, 13 Jun 2020 09:41:53 +0000 (11:41 +0200)]
avcodec/ccaption_dec: check for error codes

4 years agoavutil/internal: remove FF_ALLOCx{_ARRAY}_OR_GOTO macros
Limin Wang [Tue, 2 Jun 2020 11:18:32 +0000 (19:18 +0800)]
avutil/internal: remove FF_ALLOCx{_ARRAY}_OR_GOTO macros

These functions have a terrible design, let us fix them before extending
them.
First design mistake: no error code. A helper function for testing
memory allocation failure where AVERROR(ENOMEM) does not appear is
absurd.

Second design mistake: printing a message. Return the error code, let
the caller print the error message.

Third design mistake: hard-coded use of goto.

http://ffmpeg.org/pipermail/ffmpeg-devel/2020-May/262544.html

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoswscale/utils: remove FF_ALLOC_ARRAY_OR_GOTO macros
Limin Wang [Tue, 2 Jun 2020 13:54:21 +0000 (21:54 +0800)]
swscale/utils: remove FF_ALLOC_ARRAY_OR_GOTO macros

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/alac: remove FF_ALLOC_OR_GOTO and gotos label
Limin Wang [Fri, 29 May 2020 14:38:31 +0000 (22:38 +0800)]
avcodec/alac: remove FF_ALLOC_OR_GOTO and gotos label

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/mpegvideo_enc: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos lable
Limin Wang [Tue, 2 Jun 2020 15:59:15 +0000 (23:59 +0800)]
avcodec/mpegvideo_enc: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos lable

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/mpegpicture: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label
Limin Wang [Tue, 2 Jun 2020 15:49:28 +0000 (23:49 +0800)]
avcodec/mpegpicture: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/mpegvideo: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label
Limin Wang [Tue, 2 Jun 2020 15:42:30 +0000 (23:42 +0800)]
avcodec/mpegvideo: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/mpegvideo: simplify check for av_frame_alloc
Limin Wang [Tue, 2 Jun 2020 15:36:54 +0000 (23:36 +0800)]
avcodec/mpegvideo: simplify check for av_frame_alloc

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/iirfilter: remove FF_ALLOCZ_OR_GOTO and gotos label
Limin Wang [Mon, 1 Jun 2020 15:13:32 +0000 (23:13 +0800)]
avcodec/iirfilter: remove FF_ALLOCZ_OR_GOTO and gotos label

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/aacenc: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label
Limin Wang [Mon, 1 Jun 2020 14:48:28 +0000 (22:48 +0800)]
avcodec/aacenc: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/ac3enc_template: remove FF_ALLOC_ARRAY_OR_GOTO and gotos label
Limin Wang [Fri, 29 May 2020 14:05:46 +0000 (22:05 +0800)]
avcodec/ac3enc_template: remove FF_ALLOC_ARRAY_OR_GOTO and gotos label

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/ac3enc: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label
Limin Wang [Mon, 1 Jun 2020 16:06:55 +0000 (00:06 +0800)]
avcodec/ac3enc: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/snow: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label
Limin Wang [Mon, 1 Jun 2020 13:49:44 +0000 (21:49 +0800)]
avcodec/snow: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/dnxhdenc: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label
Limin Wang [Mon, 1 Jun 2020 13:49:12 +0000 (21:49 +0800)]
avcodec/dnxhdenc: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/twinvq: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label
Limin Wang [Mon, 1 Jun 2020 14:23:57 +0000 (22:23 +0800)]
avcodec/twinvq: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos label

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/apedec: remove FF_ALLOC_OR_GOTO and gotos lable
Limin Wang [Mon, 1 Jun 2020 13:26:53 +0000 (21:26 +0800)]
avcodec/apedec: remove FF_ALLOC_OR_GOTO and gotos lable

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec: add FF_CODEC_CAP_INIT_CLEANUP for all codecs which use ff_mpv_common_init()
Limin Wang [Wed, 3 Jun 2020 13:53:11 +0000 (21:53 +0800)]
avcodec: add FF_CODEC_CAP_INIT_CLEANUP for all codecs which use ff_mpv_common_init()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/alac: Add FF_CODEC_CAP_INIT_CLEANUP
Limin Wang [Fri, 29 May 2020 13:08:58 +0000 (21:08 +0800)]
avcodec/alac: Add FF_CODEC_CAP_INIT_CLEANUP

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/aacenc: add FF_CODEC_CAP_INIT_CLEANUP
Limin Wang [Mon, 1 Jun 2020 14:29:13 +0000 (22:29 +0800)]
avcodec/aacenc: add FF_CODEC_CAP_INIT_CLEANUP

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/ac3enc: add FF_CODEC_CAP_INIT_CLEANUP
Limin Wang [Mon, 1 Jun 2020 14:06:46 +0000 (22:06 +0800)]
avcodec/ac3enc: add FF_CODEC_CAP_INIT_CLEANUP

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/apedec: add FF_CODEC_CAP_INIT_CLEANUP
Limin Wang [Thu, 28 May 2020 15:53:46 +0000 (23:53 +0800)]
avcodec/apedec: add FF_CODEC_CAP_INIT_CLEANUP

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/adpcmenc: remove FF_ALLOC_OR_GOTO macros and gotos lable
Limin Wang [Thu, 28 May 2020 15:43:41 +0000 (23:43 +0800)]
avcodec/adpcmenc: remove FF_ALLOC_OR_GOTO macros and gotos lable

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/h264dec: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos lable
Limin Wang [Thu, 28 May 2020 15:33:04 +0000 (23:33 +0800)]
avcodec/h264dec: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos lable

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/h264dec: store count of the tables into const variable for long lines
Limin Wang [Thu, 28 May 2020 15:13:45 +0000 (23:13 +0800)]
avcodec/h264dec: store count of the tables into const variable for long lines

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/h264dec: cosmetics
Limin Wang [Wed, 27 May 2020 15:04:29 +0000 (23:04 +0800)]
avcodec/h264dec: cosmetics

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/wmalosslessdec: Check block_align maximum
Michael Niedermayer [Tue, 9 Jun 2020 20:11:23 +0000 (22:11 +0200)]
avcodec/wmalosslessdec: Check block_align maximum

Fixes: Assertion failure
Fixes: 22737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5958388889681920
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/loco: Fix signed integer overflow in loco_get_rice()
Michael Niedermayer [Tue, 9 Jun 2020 20:14:59 +0000 (22:14 +0200)]
avcodec/loco: Fix signed integer overflow in loco_get_rice()

Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 22975/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5658160970072064
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/thp: Check fps
Michael Niedermayer [Mon, 8 Jun 2020 07:28:55 +0000 (09:28 +0200)]
avformat/thp: Check fps

Fixes: division by zero
Fixes: 23162/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4856420817436672
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mpl2dec: Fix integer overflow with duration
Michael Niedermayer [Mon, 8 Jun 2020 07:47:41 +0000 (09:47 +0200)]
avformat/mpl2dec: Fix integer overflow with duration

Fixes: signed integer overflow: 9223372036854775807 - -1 cannot be represented in type 'long'
Fixes: 23167/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6425051741290496
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/cbs: Allocate more CodedBitstreamUnit at once in cbs_insert_unit()
Michael Niedermayer [Fri, 10 Apr 2020 20:05:07 +0000 (22:05 +0200)]
avcodec/cbs: Allocate more CodedBitstreamUnit at once in cbs_insert_unit()

Fixes: Timeout (85sec -> 0.5sec)
Fixes: 20791/clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_FRAME_SPLIT_fuzzer-5659537719951360
Fixes: 21214/clusterfuzz-testcase-minimized-ffmpeg_BSF_MPEG2_METADATA_fuzzer-5165560875974656
Fixes: 21247/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_METADATA_fuzzer-5715175257931776
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mov: Check if DTS is AV_NOPTS_VALUE in mov_find_next_sample().
Dale Curtis [Thu, 14 May 2020 21:38:07 +0000 (14:38 -0700)]
avformat/mov: Check if DTS is AV_NOPTS_VALUE in mov_find_next_sample().

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_vaguedenoiser: fix small typo in option explanation
Paul B Mahol [Fri, 12 Jun 2020 22:41:16 +0000 (00:41 +0200)]
avfilter/vf_vaguedenoiser: fix small typo in option explanation

4 years agoavfilter/af_rubberband: adjust nb_samples after every command
Paul B Mahol [Fri, 12 Jun 2020 10:57:43 +0000 (12:57 +0200)]
avfilter/af_rubberband: adjust nb_samples after every command

4 years agoavformat/sccdec: split line with multiple subs
Paul B Mahol [Fri, 12 Jun 2020 18:03:42 +0000 (20:03 +0200)]
avformat/sccdec: split line with multiple subs

4 years agodoc/APIchanges: add new AV_PIX_FMT_X2RGB10
Lynne [Fri, 12 Jun 2020 16:48:28 +0000 (17:48 +0100)]
doc/APIchanges: add new AV_PIX_FMT_X2RGB10

4 years agolavu/hwcontext_vaapi: add vaapi_format_map support for x2rgb10
Fei Wang [Wed, 22 Apr 2020 05:23:03 +0000 (13:23 +0800)]
lavu/hwcontext_vaapi: add vaapi_format_map support for x2rgb10

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
4 years agoswscale: Add swscale input/output support for X2RGB10LE
Fei Wang [Wed, 22 Apr 2020 05:23:02 +0000 (13:23 +0800)]
swscale: Add swscale input/output support for X2RGB10LE

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
4 years agolavu/pix_fmt: add new pixel format x2rgb10
Fei Wang [Wed, 22 Apr 2020 05:23:01 +0000 (13:23 +0800)]
lavu/pix_fmt: add new pixel format x2rgb10

The format is packed RGB with each channel 10 bits available and
include 2 bits unused.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
4 years agomailmap: add entry for myself
Steven Liu [Fri, 12 Jun 2020 06:30:02 +0000 (14:30 +0800)]
mailmap: add entry for myself

4 years agotools/target_dec_fuzzer: Adjust threshold for lagarith
Michael Niedermayer [Sun, 7 Jun 2020 17:08:01 +0000 (19:08 +0200)]
tools/target_dec_fuzzer: Adjust threshold for lagarith

Fixes: Timeout (3minute 49 sec -> 3sec)
Fixes: 22020/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LAGARITH_fuzzer-5708544679870464
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/mpeg12dec: remove outdated comments
Michael Niedermayer [Sat, 6 Jun 2020 17:42:07 +0000 (19:42 +0200)]
avcodec/mpeg12dec: remove outdated comments

Found-by: Kieran
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/snowdec: Avoid integer overflow with huge qlog
Michael Niedermayer [Sat, 6 Jun 2020 15:45:39 +0000 (17:45 +0200)]
avcodec/snowdec: Avoid integer overflow with huge qlog

Fixes: integer overflow
Fixes: 22285/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5682428762128384
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/movtextdec: Fix shift overflows in mov_text_init()
Michael Niedermayer [Fri, 5 Jun 2020 16:22:51 +0000 (18:22 +0200)]
avcodec/movtextdec: Fix shift overflows in mov_text_init()

Fixes: left shift of 243 by 24 places cannot be represented in type 'int'
Fixes: 22716/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOVTEXT_fuzzer-5704263425851392
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agotools/target_dem_fuzzer: Use file extensions listed in input formats
Michael Niedermayer [Mon, 8 Jun 2020 09:26:45 +0000 (11:26 +0200)]
tools/target_dem_fuzzer: Use file extensions listed in input formats

This should make it easier for the fuzzer to fuzz formats being detected only by
file extension and thus increase coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavutil: add AV_FRAME_DATA_SEI_UNREGISTERED side data type
Limin Wang [Wed, 10 Jun 2020 15:34:30 +0000 (23:34 +0800)]
avutil: add AV_FRAME_DATA_SEI_UNREGISTERED side data type

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agodnn-layer-mathunary-test: add unit test for tan
Ting Fu [Sat, 6 Jun 2020 12:12:51 +0000 (20:12 +0800)]
dnn-layer-mathunary-test: add unit test for tan

Signed-off-by: Ting Fu <ting.fu@intel.com>
Signed-off-by: Guo Yejun <yejun.guo@intel.com>