]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoavutil/eval: add function to track variable use
Gyan Doshi [Sun, 17 Nov 2019 05:32:10 +0000 (11:02 +0530)]
avutil/eval: add function to track variable use

1)Some filters allow cross-referenced expressions e.g. x=y+10. In
such cases, filters evaluate expressions multiple times for
successful evaluation of all expressions. If the expression for one or
more variables contains a RNG, the result may vary across evaluation
leading to inconsistent values across the cross-referenced expressions.

2)A related case is circular expressions e.g. x=y+10 and y=x+10 which
cannot be succesfully resolved.

3)Certain filter variables may only be applicable in specific eval modes
and lead to a failure of evaluation in other modes e.g. pts is only
relevant for frame eval mode.

At present, there is no reliable means to identify these occurrences and
thus the error messages provided are broad or inaccurate. The helper
function introduced - av_expr_count_vars - allows developers to identify
the use and count of variables in expressions and thus tailor the error
message, allow for a graceful fallback and/or decide evaluation order.

4 years agolavf/rtmpproto: fix the playpath truncation if the len > 512
Jun Zhao [Fri, 15 Nov 2019 11:10:47 +0000 (19:10 +0800)]
lavf/rtmpproto: fix the playpath truncation if the len > 512

fix the playpath truncation if the len > 512

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Found-by: liuwenhuang <liuwenhuang@tencent.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavcodec/nvenc: make sure newly allocated packets are refcounted
Timo Rothenpieler [Sun, 17 Nov 2019 00:27:44 +0000 (01:27 +0100)]
avcodec/nvenc: make sure newly allocated packets are refcounted

Fixes ticket 8383

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
4 years agolavc/libopencore-amr: Silence a warning about an unused function.
Carl Eugen Hoyos [Sat, 16 Nov 2019 23:35:14 +0000 (00:35 +0100)]
lavc/libopencore-amr: Silence a warning about an unused function.

4 years agoavfilter/vf_framepack: really fix ef466a8b29f8
Paul B Mahol [Sat, 16 Nov 2019 23:21:18 +0000 (00:21 +0100)]
avfilter/vf_framepack: really fix ef466a8b29f8

4 years agoavfilter/vf_framepack: switch to activate
Paul B Mahol [Sat, 16 Nov 2019 22:53:39 +0000 (23:53 +0100)]
avfilter/vf_framepack: switch to activate

4 years agoavformat/mp3dec: Check for occurances of headers within frames during probing
Limin Wang [Thu, 7 Nov 2019 16:16:22 +0000 (00:16 +0800)]
avformat/mp3dec: Check for occurances of headers within frames during probing

Fixes misdetection of zYLx.wav

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mp3dec: Check that the frame fits within the probe buffer
Michael Niedermayer [Thu, 7 Nov 2019 20:16:32 +0000 (21:16 +0100)]
avformat/mp3dec: Check that the frame fits within the probe buffer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_framepack: fix timestamps for frameseq format
Paul B Mahol [Sat, 16 Nov 2019 22:31:03 +0000 (23:31 +0100)]
avfilter/vf_framepack: fix timestamps for frameseq format

4 years agoavfilter/vf_framepack: add missing filtering flag
Paul B Mahol [Sat, 16 Nov 2019 22:18:36 +0000 (23:18 +0100)]
avfilter/vf_framepack: add missing filtering flag

4 years agoavcodec/mjpeg_parser: Make parser a bit more robust with unclean input
Michael Niedermayer [Thu, 10 Oct 2019 20:23:41 +0000 (22:23 +0200)]
avcodec/mjpeg_parser: Make parser a bit more robust with unclean input

Helps: test_roman.mjpeg (note this is not really just mjpeg)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/put_bits: Relax requirements to rebase PutBitContext
Andreas Rheinhardt [Sat, 16 Nov 2019 05:24:29 +0000 (06:24 +0100)]
avcodec/put_bits: Relax requirements to rebase PutBitContext

The earlier requirement was for the new buffer to be bigger than the old
one. This has been relaxed to only demand that the new buffer can hold
all the data written so far. This is in preparation for further commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mov: fix typo in help text
Zhao Zhili [Fri, 15 Nov 2019 16:33:59 +0000 (00:33 +0800)]
avformat/mov: fix typo in help text

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/av1dec: simplify annexb_probe()
James Almer [Fri, 15 Nov 2019 23:34:08 +0000 (20:34 -0300)]
avformat/av1dec: simplify annexb_probe()

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/cbs_av1: fix reading reference order hint in skip_mode_params()
James Almer [Fri, 15 Nov 2019 18:12:14 +0000 (15:12 -0300)]
avcodec/cbs_av1: fix reading reference order hint in skip_mode_params()

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/codec_desc: add mising .type for acelp.kelvin
Paul B Mahol [Sat, 16 Nov 2019 14:06:20 +0000 (15:06 +0100)]
avcodec/codec_desc: add mising .type for acelp.kelvin

4 years agovcodec/agm: Alloc based on coded dimensions
Michael Niedermayer [Thu, 14 Nov 2019 14:10:28 +0000 (15:10 +0100)]
vcodec/agm: Alloc based on coded dimensions

Fixes: out of array read
Fixes: 18715/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5659333417500672
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>
4 years agoavcodec/encode: add missing assert to avcodec_receive_packet()
James Almer [Sat, 9 Nov 2019 23:08:17 +0000 (20:08 -0300)]
avcodec/encode: add missing assert to avcodec_receive_packet()

Encoders must return reference counted packets.

This was checked only for encoders using the AVCodec->encode2() API, while
blindly accepting whatever encoders using the AVCodec->receive_packet() API
were returning.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/av1dec: Redo flushing of bsf
Andreas Rheinhardt [Thu, 14 Nov 2019 14:06:27 +0000 (15:06 +0100)]
avformat/av1dec: Redo flushing of bsf

The current approach has two different calls to av_bsf_send_packet():
A normal one, sending a packet; and an extraordinary one just for
flushing. These can be unified into one by making use of the newly
documented fact that av_bsf_send_packet() allows to signal flushing via
empty packets (i.e. packets without data and side-data).

This also fixes CID 1455685 which resulted from the fact that the call
for flushing was not checked given that it couldn't fail.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/avcodec: Adapt the doc of av_bsf_send_packet to match its actual implementation.
Andreas Rheinhardt [Thu, 14 Nov 2019 14:44:15 +0000 (15:44 +0100)]
avcodec/avcodec: Adapt the doc of av_bsf_send_packet to match its actual implementation.

Explicitly allowing empty packets to signal flushing helps getting rid
of special cases. It does not hinder the ability to send i.e.
timing-only packets, because one can send packets with zero size and
pkt->data set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/id3v2: Avoid av_strdup for key and value of dict
Andreas Rheinhardt [Sun, 10 Nov 2019 18:04:51 +0000 (19:04 +0100)]
avformat/id3v2: Avoid av_strdup for key and value of dict

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>
4 years agotests/ref/vsynth: add missing reference files, fix build
Michael Niedermayer [Wed, 13 Nov 2019 22:18:58 +0000 (23:18 +0100)]
tests/ref/vsynth: add missing reference files, fix build

4 years agolibrav1e: Don't make users explicitly set -qp -1 to use bit rate mode
Derek Buitenhuis [Mon, 11 Nov 2019 14:15:41 +0000 (14:15 +0000)]
librav1e: Don't make users explicitly set -qp -1 to use bit rate mode

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
4 years agoavcodec/dvenc: support encoding dvcprohd
Baptiste Coudurier [Sat, 9 Nov 2019 23:54:16 +0000 (15:54 -0800)]
avcodec/dvenc: support encoding dvcprohd

4 years agoavformat/mxfenc: correctly set width values for dvcprohd
Baptiste Coudurier [Mon, 26 Aug 2019 20:15:32 +0000 (13:15 -0700)]
avformat/mxfenc: correctly set width values for dvcprohd

4 years agoavfilter/vf_colorbalance: add support for commands
Paul B Mahol [Wed, 13 Nov 2019 11:59:17 +0000 (12:59 +0100)]
avfilter/vf_colorbalance: add support for commands

4 years agoavfilter/vf_colorbalance: switch to floats
Paul B Mahol [Wed, 13 Nov 2019 11:56:04 +0000 (12:56 +0100)]
avfilter/vf_colorbalance: switch to floats

4 years agoavfilter/vf_colorbalance: add option to preserve lightness
Paul B Mahol [Wed, 13 Nov 2019 11:26:18 +0000 (12:26 +0100)]
avfilter/vf_colorbalance: add option to preserve lightness

4 years agoavformat/hlsenc: free the original malloc pointer to avoid error when system function...
Limin Wang [Wed, 23 Oct 2019 15:55:16 +0000 (23:55 +0800)]
avformat/hlsenc: free the original malloc pointer to avoid error when system function used in the following patch

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/hls: continue to play enabled playlist when have failed playlist
Steven Liu [Tue, 3 Sep 2019 01:55:17 +0000 (09:55 +0800)]
avformat/hls: continue to play enabled playlist when have failed playlist

fix ticket: 7811

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavformat: add an AV1 Annex B demuxer
James Almer [Mon, 11 Nov 2019 00:20:30 +0000 (21:20 -0300)]
avformat: add an AV1 Annex B demuxer

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/libdav1d: export bitstream timing info when available
James Almer [Mon, 11 Nov 2019 00:10:05 +0000 (21:10 -0300)]
avcodec/libdav1d: export bitstream timing info when available

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/av1_parser: export bitstream timing info when available
James Almer [Mon, 11 Nov 2019 00:09:51 +0000 (21:09 -0300)]
avcodec/av1_parser: export bitstream timing info when available

Based on h264_parser code.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec: add an AV1 frame merge bitstream filter
James Almer [Mon, 11 Nov 2019 00:09:02 +0000 (21:09 -0300)]
avcodec: add an AV1 frame merge bitstream filter

This BSF takes Temporal Units split across different AVPackets and merges them
by looking for Temporal Delimiter OBUs.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/cbs_av1: support one byte long OBUs when the size is not set in the bitstream
James Almer [Mon, 11 Nov 2019 00:08:37 +0000 (21:08 -0300)]
avcodec/cbs_av1: support one byte long OBUs when the size is not set in the bitstream

This will be needed by the next commit, where packets with a single Temporal
Delimiter OBU with no size will need to be parsed

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vF_colorbalance: rewrite, fixes filtering
Paul B Mahol [Tue, 12 Nov 2019 23:22:13 +0000 (00:22 +0100)]
avfilter/vF_colorbalance: rewrite, fixes filtering

4 years agoavutil/frame: fix remove_side_data
Zhao Zhili [Sat, 2 Nov 2019 17:41:18 +0000 (01:41 +0800)]
avutil/frame: fix remove_side_data

remove_side_data is supposed to remove a single instance by design.
Since new_side_data() doesn't forbid add multiple instances of the
same type, remove_side_data should deal with that.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/arm/mlpdsp: add missing dependency for truehd
Aman Gupta [Wed, 6 Nov 2019 19:07:41 +0000 (11:07 -0800)]
avcodec/arm/mlpdsp: add missing dependency for truehd

Signed-off-by: Aman Gupta <aman@tmm1.net>
4 years agoavformat/mp3dec: replace SAME_HEADER_MASK with MP3_MASK
Limin Wang [Mon, 11 Nov 2019 01:05:02 +0000 (09:05 +0800)]
avformat/mp3dec: replace SAME_HEADER_MASK with MP3_MASK

mp3 header bitstream syntax:
header()
{
    syncword   12bits bslsf
    id         1bit    bslsf
    layer      2bit    bslsf
    protection_bit 1bit bslsf
    bitrate_index 4bits bslsf
    sampling_frequency 2bits bslsf
    padding_bit  1bit bslsf
    private_bit 1bit bslsf
    mode 2bits bslsf
    mode_extension 2bits bslsf
    copyright 1bit bslsf
    original/home 1bit bslsf
    emphasis 2bits bslsf
}

if the header is masking with MP3_MASK(0xFFFE0CCF), below fields will be cleared:
protection_bit, bitrate_index, sampling_freqency, mode

with SAME_HEADER_MASK(0xFFFE0C00), extra below fields will be cleared which didn't make
sense:
mode_extension, copyright, original/home, emphasis

As the MP3_MASK is good for same mp3 header masking and is defined in the
header, so it's preferable to remove SAME_HEADER_MASK to keep the masking same.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mp3dec: cosmetics
Limin Wang [Mon, 11 Nov 2019 01:05:01 +0000 (09:05 +0800)]
avformat/mp3dec: cosmetics

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/dvdec: Don't use restrict directly to fix build on MSVC
Andreas Rheinhardt [Sun, 10 Nov 2019 01:47:24 +0000 (02:47 +0100)]
avcodec/dvdec: Don't use restrict directly to fix build on MSVC

004ebd4b added a function with a parameter that was declared as restrict
and not av_restrict. This is not supported by MSVC as several FATE-boxes
that now fail to build show. So use av_restrict.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tested-by: Matthias Troffaes <matthias.troffaes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agotests/fate/filter-video: add test for colorlevels
Limin Wang [Wed, 23 Oct 2019 10:27:41 +0000 (18:27 +0800)]
tests/fate/filter-video: add test for colorlevels

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/librav1e: free the RaPacket after using it
James Almer [Mon, 11 Nov 2019 01:15:44 +0000 (22:15 -0300)]
avcodec/librav1e: free the RaPacket after using it

Fixes leaks.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec: Add librav1e encoder
Derek Buitenhuis [Wed, 29 May 2019 18:28:24 +0000 (19:28 +0100)]
avcodec: Add librav1e encoder

Port to the new send/receive API by: James Almer <jamrial@gmail.com>.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
4 years agoavcodec/wmaprodec: get frame during frame decode
Michael Niedermayer [Wed, 25 Sep 2019 13:54:45 +0000 (15:54 +0200)]
avcodec/wmaprodec: get frame during frame decode

Fixes: memleak
Fixes: 17615/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA2_fuzzer-5681306024804352
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>
4 years agoavcodec/interplayacm: Fix overflow of last unused value
Michael Niedermayer [Fri, 25 Oct 2019 10:44:45 +0000 (12:44 +0200)]
avcodec/interplayacm: Fix overflow of last unused value

Fixes: signed integer overflow: -2147450880 - 65535 cannot be represented in type 'int'
Fixes: 18393/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INTERPLAY_ACM_fuzzer-5667520110919680
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/adpcm: Fix undefined behavior with negative predictions in IMA OKI
Michael Niedermayer [Fri, 25 Oct 2019 09:12:02 +0000 (11:12 +0200)]
avcodec/adpcm: Fix undefined behavior with negative predictions in IMA OKI

Fixes: left shift of negative value -30
Fixes: 18392/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_OKI_fuzzer-5631771831435264
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/cook: Move up and extend block_align check
Michael Niedermayer [Thu, 24 Oct 2019 23:12:15 +0000 (01:12 +0200)]
avcodec/cook: Move up and extend block_align check

Fixes: signed integer overflow: 2046820356 * 8 cannot be represented in type 'int'
Fixes: 18391/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COOK_fuzzer-5631674666188800
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/sbcdec: Fix integer overflows in sbc_synthesize_four()
Michael Niedermayer [Mon, 21 Oct 2019 22:09:11 +0000 (00:09 +0200)]
avcodec/sbcdec: Fix integer overflows in sbc_synthesize_four()

Fixes: signed integer overflow: 1494495519 + 1494495519 cannot be represented in type 'int'
Fixes: 18347/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SBC_fuzzer-5711714661695488
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/twinvq: Check block_align
Michael Niedermayer [Tue, 22 Oct 2019 13:41:51 +0000 (15:41 +0200)]
avcodec/twinvq: Check block_align

Fixes: signed integer overflow: 538976288 * 8 cannot be represented in type 'int'
Fixes: 18348/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_METASOUND_fuzzer-6681325716635648
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/cook: Enlarge gain table
Michael Niedermayer [Wed, 23 Oct 2019 17:59:57 +0000 (19:59 +0200)]
avcodec/cook: Enlarge gain table

Fixes: index 25 out of bounds for type 'float [23]'
Fixes: 18355/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COOK_fuzzer-5641398941908992
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/cook: Check samples_per_channel earlier
Michael Niedermayer [Wed, 23 Oct 2019 17:41:27 +0000 (19:41 +0200)]
avcodec/cook: Check samples_per_channel earlier

Fixes: division by zero
Fixes: 18362/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COOK_fuzzer-5653727679086592
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/atrac3plus: Check split point in fill mode 3
Michael Niedermayer [Tue, 22 Oct 2019 20:02:32 +0000 (22:02 +0200)]
avcodec/atrac3plus: Check split point in fill mode 3

Fixes: index 32 out of bounds for type 'int [32]'
Fixes: 18350/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3P_fuzzer-5643794862571520
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/wmavoice: Check sample_rate
Michael Niedermayer [Wed, 23 Oct 2019 20:32:47 +0000 (22:32 +0200)]
avcodec/wmavoice: Check sample_rate

Fixes: left shift of 538976288 by 8 places cannot be represented in type 'int'
Fixes: 18376/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5741645391200256
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/xsubdec: fix overflow in alpha handling
Michael Niedermayer [Wed, 23 Oct 2019 20:08:37 +0000 (22:08 +0200)]
avcodec/xsubdec: fix overflow in alpha handling

Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 18368/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XSUB_fuzzer-5702665442426880
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: Check available space before entering loop in decode_long_vertical_delta...
Michael Niedermayer [Wed, 23 Oct 2019 21:31:03 +0000 (23:31 +0200)]
avcodec/iff: Check available space before entering loop in decode_long_vertical_delta2() / decode_long_vertical_delta()

Fixes: Timeout (31sec -> 41ms)
Fixes: 18380/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5645210121404416
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/apedec: Fix integer overflow in filter_3800()
Michael Niedermayer [Sun, 20 Oct 2019 22:26:25 +0000 (00:26 +0200)]
avcodec/apedec: Fix integer overflow in filter_3800()

Fixes: signed integer overflow: 2117181180 + 60483298 cannot be represented in type 'int'
Fixes: 18344/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5685327791915008
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/atrac3plusdec: add FF_CODEC_CAP_INIT_CLEANUP
Michael Niedermayer [Sat, 19 Oct 2019 17:32:12 +0000 (19:32 +0200)]
avcodec/atrac3plusdec: add FF_CODEC_CAP_INIT_CLEANUP

Fixes: memleaks
Fixes: 18332/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3P_fuzzer-5655654374572032
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 agoavutil/lfg: Document the AVLFG struct
Michael Niedermayer [Sun, 20 Oct 2019 10:12:12 +0000 (12:12 +0200)]
avutil/lfg: Document the AVLFG struct

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/decode: Also consider channels in max_samples check
Michael Niedermayer [Fri, 18 Oct 2019 20:24:04 +0000 (22:24 +0200)]
avcodec/decode: Also consider channels in max_samples check

Fixes: Timeout (109sec -> 0.6sec)
Fixes: 18309/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INTERPLAY_ACM_fuzzer-6226598168100864
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/rasc: Check input size in decode_fint()
Michael Niedermayer [Thu, 17 Oct 2019 21:57:26 +0000 (23:57 +0200)]
avcodec/rasc: Check input size in decode_fint()

Fixes: Timeout (11sec -> 42ms)
Fixes: 18287/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5637866331308032
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/ffv1dec: Use a different error message for the slice level CRC
Michael Niedermayer [Thu, 17 Oct 2019 21:22:22 +0000 (23:22 +0200)]
avcodec/ffv1dec: Use a different error message for the slice level CRC

This way they can be told apart easily

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/apedec: Fix undefined integer overflow in long_filter_ehigh_3830()
Michael Niedermayer [Thu, 17 Oct 2019 18:56:23 +0000 (20:56 +0200)]
avcodec/apedec: Fix undefined integer overflow in long_filter_ehigh_3830()

Fixes: signed integer overflow: -1094995529 * 2 cannot be represented in type 'int'
Fixes: 18281/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5692589180715008
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/flvenc: Check pts for mpeg4/h264 (which need the value)
Michael Niedermayer [Tue, 15 Oct 2019 20:18:45 +0000 (22:18 +0200)]
avformat/flvenc: Check pts for mpeg4/h264 (which need the value)

Fixes: Ticket8152
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/dstdec: Check that AC probabilities are within range
Michael Niedermayer [Tue, 15 Oct 2019 21:42:50 +0000 (23:42 +0200)]
avcodec/dstdec: Check that AC probabilities are within range

ISO/IEC 14496-3:2005(E): "Each entry of P_one[ ][ ] is in the range of 1 to
128, corresponding to a probability of 1/256 to 128/256 of the next error bit (bit E, See Figure 10.5)..."

Fixes: Timeout (42sec ->1sec)
Fixes: 18181/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5736646250594304
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/dstdec: Check read_table() for failure
Michael Niedermayer [Tue, 15 Oct 2019 21:40:21 +0000 (23:40 +0200)]
avcodec/dstdec: Check read_table() for failure

Fixes: Timeout (too long -> 42sec)
Fixes: 18181/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5736646250594304
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/vc1_block: Check input in the block decode loops
Michael Niedermayer [Sat, 12 Oct 2019 14:59:46 +0000 (16:59 +0200)]
avcodec/vc1_block: Check input in the block decode loops

Fixes: Timeout (196sec -> 2sec)
Fixes: 18026/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5640941108461568
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/vc1_block: Check for end of bitstream at the top of vc1_decode_i_blocks_adv()
Michael Niedermayer [Sat, 28 Sep 2019 20:44:18 +0000 (22:44 +0200)]
avcodec/vc1_block: Check for end of bitstream at the top of vc1_decode_i_blocks_adv()

Fixes: Timeout (147sec -> 2sec)
Fixes: 17704/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5723851098423296
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_dec_fuzzer: Adjust threshold for smacker
Michael Niedermayer [Thu, 10 Oct 2019 16:51:19 +0000 (18:51 +0200)]
tools/target_dec_fuzzer: Adjust threshold for smacker

Fixes: Timeout (65sec -> 0.5sec)
Fixes: 18072/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKER_fuzzer-5722709366931456
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/hqx: Check the input data against the image size
Michael Niedermayer [Sat, 20 Jul 2019 21:37:38 +0000 (23:37 +0200)]
avcodec/hqx: Check the input data against the image size

Fixes: Timeout (22 -> 100 ms)
Fixes: 15173/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQX_fuzzer-5662556846292992
Fixes: 17896/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQX_fuzzer-5679312077848576
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/pafvideo: Only clear frame when it was written to
Michael Niedermayer [Tue, 6 Aug 2019 21:07:01 +0000 (23:07 +0200)]
avcodec/pafvideo: Only clear frame when it was written to

This avoids unneeded operations and makes the code faster.

Fixes: Timeout
Fixes: 15724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAF_VIDEO_fuzzer-5750842205929472 (12sec -> 9sec)
Fixes: 17625/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAF_VIDEO_fuzzer-5640515311108096 (16sec -> 4sec)
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/vividas: Fix n_sb_blocks Check
Michael Niedermayer [Mon, 14 Oct 2019 21:17:51 +0000 (23:17 +0200)]
avformat/vividas: Fix n_sb_blocks Check

Fixes: signed integer overflow: 1540265776 * 2 cannot be represented in type 'int'
Fixes: 18160/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5758808818712576
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/snowenc: Set mb_num to avoid ratecontrol floating point divisions by 0.0
Michael Niedermayer [Mon, 14 Oct 2019 21:03:50 +0000 (23:03 +0200)]
avcodec/snowenc: Set mb_num to avoid ratecontrol floating point divisions by 0.0

Fixes: Ticket7990
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/snowenc: Fix 2 undefined shifts
Michael Niedermayer [Mon, 14 Oct 2019 20:51:57 +0000 (22:51 +0200)]
avcodec/snowenc: Fix 2 undefined shifts

Fixes: Ticket7990
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mlvdec:drop unnecessary check before ff_format_io_close
Steven Liu [Sat, 9 Nov 2019 02:27:14 +0000 (11:27 +0900)]
avformat/mlvdec:drop unnecessary check before ff_format_io_close

Reviewed-by: Linjie Fu <linjie.fu@intel.com>
Reviewed-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavcodec/libvpxenc,cosmetics: fix a typo
James Zern [Sat, 9 Nov 2019 01:48:29 +0000 (17:48 -0800)]
avcodec/libvpxenc,cosmetics: fix a typo

predicition -> prediction

4 years agoavcodec/libvpxdec.c,cosmetics: bpp -> bpc
James Zern [Wed, 6 Nov 2019 22:05:23 +0000 (14:05 -0800)]
avcodec/libvpxdec.c,cosmetics: bpp -> bpc

Signed-off-by: James Zern <jzern@google.com>
4 years agoavfilter/Makefile: add missing framesync dependency to bm3d & mix filters
Lou Logan [Wed, 6 Nov 2019 19:37:09 +0000 (10:37 -0900)]
avfilter/Makefile: add missing framesync dependency to bm3d & mix filters

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoconfigure: select missing rdft for several filters
Lou Logan [Wed, 6 Nov 2019 19:35:28 +0000 (10:35 -0900)]
configure: select missing rdft for several filters

afir, sinc, superequalizer, surround

For afir fft is replaced with rdft as:
rdft_select="fft"

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoavfilter/vf_dnn_processing: correct duplicate statement
leozhang [Fri, 8 Nov 2019 03:55:10 +0000 (11:55 +0800)]
avfilter/vf_dnn_processing: correct duplicate statement

Signed-off-by: leozhang <leozhang@qiyi.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_dnn_processing: fix fate-source
Guo, Yejun [Fri, 8 Nov 2019 07:51:40 +0000 (15:51 +0800)]
avfilter/vf_dnn_processing: fix fate-source

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mxfdec: cleanup on "essence prior to first PartitionPack"
Michael Niedermayer [Thu, 31 Oct 2019 12:30:52 +0000 (13:30 +0100)]
avformat/mxfdec: cleanup on "essence prior to first PartitionPack"

Fixes: memleak
Fixes: 18473/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5738557074833408
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 agoavfilter/f_metadata: remove unneeded code
Limin Wang [Thu, 10 Oct 2019 06:03:54 +0000 (14:03 +0800)]
avfilter/f_metadata: remove unneeded code

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agolavf/dashdec: drop unnecessary check before ff_format_io_close
Jun Zhao [Mon, 23 Sep 2019 16:30:17 +0000 (00:30 +0800)]
lavf/dashdec: drop unnecessary check before ff_format_io_close

ff_format_io_close will check the AVIOContext pointer pb, so drop
the unnecessary check before ff_format_io_close.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/dashenc: enable probesize/max_analyze_duration setting in sub-demuxer
Jun Zhao [Sat, 2 Nov 2019 14:46:00 +0000 (22:46 +0800)]
lavf/dashenc: enable probesize/max_analyze_duration setting in sub-demuxer

Enable probesize/max_analyze_duration setting when open the sub-demuxer,
it's will be used to minimizing the initial delay.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/hls: support probesize/max_analyze_duration when open sub-demuxer
Jun Zhao [Sat, 2 Nov 2019 11:48:28 +0000 (19:48 +0800)]
lavf/hls: support probesize/max_analyze_duration when open sub-demuxer

Add probesize/max_analyze_duration support when open the sub-demuxer,
it's will be used to minimizing the initial delay.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/flvenc: Cosmetics: fix indentation
Jun Zhao [Sat, 2 Nov 2019 11:59:45 +0000 (19:59 +0800)]
lavf/flvenc: Cosmetics: fix indentation

fix indentation

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/mov: add log context dump in log message
Jun Zhao [Sun, 27 Oct 2019 02:01:30 +0000 (10:01 +0800)]
lavf/mov: add log context dump in log message

add log context dump in log message.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/hls: fix the log context setting in log message
Jun Zhao [Sun, 27 Oct 2019 02:00:24 +0000 (10:00 +0800)]
lavf/hls: fix the log context setting in log message

Fix the log context setting in log message

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavfilter/vf_dnn_processing: add a generic filter for image proccessing with dnn networks
Guo, Yejun [Thu, 31 Oct 2019 08:33:02 +0000 (16:33 +0800)]
avfilter/vf_dnn_processing: add a generic filter for image proccessing with dnn networks

This filter accepts all the dnn networks which do image processing.
Currently, frame with formats rgb24 and bgr24 are supported. Other
formats such as gray and YUV will be supported next. The dnn network
can accept data in float32 or uint8 format. And the dnn network can
change frame size.

The following is a python script to halve the value of the first
channel of the pixel. It demos how to setup and execute dnn model
with python+tensorflow. It also generates .pb file which will be
used by ffmpeg.

import tensorflow as tf
import numpy as np
import imageio
in_img = imageio.imread('in.bmp')
in_img = in_img.astype(np.float32)/255.0
in_data = in_img[np.newaxis, :]
filter_data = np.array([0.5, 0, 0, 0, 1., 0, 0, 0, 1.]).reshape(1,1,3,3).astype(np.float32)
filter = tf.Variable(filter_data)
x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
y = tf.nn.conv2d(x, filter, strides=[1, 1, 1, 1], padding='VALID', name='dnn_out')
sess=tf.Session()
sess.run(tf.global_variables_initializer())
output = sess.run(y, feed_dict={x: in_data})
graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
tf.train.write_graph(graph_def, '.', 'halve_first_channel.pb', as_text=False)
output = output * 255.0
output = output.astype(np.uint8)
imageio.imsave("out.bmp", np.squeeze(output))

To do the same thing with ffmpeg:
- generate halve_first_channel.pb with the above script
- generate halve_first_channel.model with tools/python/convert.py
- try with following commands
  ./ffmpeg -i input.jpg -vf dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:fmt=rgb24:dnn_backend=native -y out.native.png
  ./ffmpeg -i input.jpg -vf dnn_processing=model=halve_first_channel.pb:input=dnn_in:output=dnn_out:fmt=rgb24:dnn_backend=tensorflow -y out.tf.png

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agofftools/ffmpeg_opt: Fix mixed declarations and code
Andreas Rheinhardt [Wed, 6 Nov 2019 12:18:16 +0000 (13:18 +0100)]
fftools/ffmpeg_opt: Fix mixed declarations and code

Introduced in ed3c317d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/extract_extradata_bsf: fix typo in comments
leozhang [Wed, 6 Nov 2019 07:00:59 +0000 (15:00 +0800)]
avcodec/extract_extradata_bsf: fix typo in comments

Signed-off-by: leozhang <leozhang@qiyi.com>
Reviewed-by: Gyan <ffmpeg@gyani.pro>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavdevice/v4l2: Remove av_assert0 when format not supported
Andriy Gelman [Tue, 5 Nov 2019 03:32:59 +0000 (22:32 -0500)]
avdevice/v4l2: Remove av_assert0 when format not supported

Before this commit an av_assert0 would fail if a v4l2 device did not
support a target format.
For example,
./ffmpeg -f v4l2 -codec:v h264 -i /dev/video0 -f mpegts -
would signal an abort if /dev/video0 did not support h264.

The new behaviour is to return an AVERROR(EINVAL) error code. An
av_assert0 has been added to verify this return.

Fixes #6629

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/Makefile: add missing msmpeg4* dependencies to wmv1 encoder
Lou Logan [Tue, 5 Nov 2019 19:28:07 +0000 (10:28 -0900)]
avcodec/Makefile: add missing msmpeg4* dependencies to wmv1 encoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoavcodec/Makefile: add missing h263data dependency to snow encoder
Lou Logan [Tue, 5 Nov 2019 19:21:10 +0000 (10:21 -0900)]
avcodec/Makefile: add missing h263data dependency to snow encoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoavcodec/Makefile: add missing vorbis_data dependency to opus encoder
Lou Logan [Tue, 5 Nov 2019 19:17:01 +0000 (10:17 -0900)]
avcodec/Makefile: add missing vorbis_data dependency to opus encoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoconfigure: select mdct for dca encoder
Lou Logan [Tue, 5 Nov 2019 19:01:55 +0000 (10:01 -0900)]
configure: select mdct for dca encoder

Signed-off-by: Lou Logan <lou@lrcd.com>
4 years agoavcodec/dvdec: correctly decode bottom mb row in 1080i field mode
Baptiste Coudurier [Tue, 18 Jun 2019 20:29:41 +0000 (13:29 -0700)]
avcodec/dvdec: correctly decode bottom mb row in 1080i field mode

4 years agoavcodec/dvdec: correctly set interlaced and tff
Baptiste Coudurier [Fri, 28 Jun 2019 17:33:05 +0000 (10:33 -0700)]
avcodec/dvdec: correctly set interlaced and tff

4 years agoavcodec/libvpxdec: reject video and alpha dimension mismatches
Marton Balint [Sun, 27 Oct 2019 17:10:36 +0000 (18:10 +0100)]
avcodec/libvpxdec: reject video and alpha dimension mismatches

Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>