]> git.sesse.net Git - ffmpeg/log
ffmpeg
5 years agoavcodec/iff: finetune the palette size check in the mask case
Michael Niedermayer [Sat, 22 Jun 2019 19:17:52 +0000 (21:17 +0200)]
avcodec/iff: finetune the palette size check in the mask case

Fixes: out of array access
Fixes: 15381/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5668057826983936
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/iff: Fix mask_buf / mask_palbuf leak
Michael Niedermayer [Sat, 22 Jun 2019 18:05:15 +0000 (20:05 +0200)]
avcodec/iff: Fix mask_buf / mask_palbuf leak

Fixes: 15372/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5708881759567872
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/matroskadec: Don't keep old blocks
Andreas Rheinhardt [Thu, 16 May 2019 22:29:59 +0000 (00:29 +0200)]
avformat/matroskadec: Don't keep old blocks

Before this commit, the Matroska muxer would read a block when required
to do so, parse the block, create and return the necessary AVPackets and
yet keep the blocks (in a dynamically allocated list), although they
aren't used at all any more. This has been changed. There is no list any
more and the block is immediately discarded after parsing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavformat/matroskadec: Remove redundant initialization
Andreas Rheinhardt [Thu, 16 May 2019 22:29:53 +0000 (00:29 +0200)]
avformat/matroskadec: Remove redundant initialization

Every new element of an EbmlList is zeroed initially in
ebml_parse_elem, so that in particular a SimpleBlock's duration is
initialized to zero. Therefore it is unnecessary to initialize this
field again (for SimpleBlocks) in matroska_parse_cluster_incremental.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavformat/matroskadec: Set offset of first cluster
Andreas Rheinhardt [Thu, 16 May 2019 22:29:51 +0000 (00:29 +0200)]
avformat/matroskadec: Set offset of first cluster

By default, the data_offset member of the AVFormatInternal of the
AVFormatContext associated with the MatroskaDemuxContext has not been
initialized explicitly by any Matroska-specific function, so that it was
initialized by default to the offset at the end of matroska_read_header,
i.e. usually to the offset of the length field of the first encountered
cluster. This meant that in case that the Matroska-specific seek-code
fails because there are no index entries for the target track a seek to
data_offset would be performed and ordinary parsing would start from
there which is nonsense: The length field would be treated as EBML ID and
(if the length field is not longer than four bytes (EBML numbers that
long are rejected as invalid EBML IDs)) whatever comes next would be
treated as its EBML size although it simply isn't.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavformat/matroskadec: Get rid of cluster size field assumption
Andreas Rheinhardt [Thu, 16 May 2019 22:29:49 +0000 (00:29 +0200)]
avformat/matroskadec: Get rid of cluster size field assumption

The earlier code relied on the length of clusters always being coded on
eight bytes as was the behaviour of libavformat's Matroska muxer until
recently. But given that our own Matroska muxer now (and mkvmerge from
time immemorial) creates files that don't conform to this assumption,
it is high time to get rid of this assumption.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavformat/matroskadec: Remove non-incremental parsing of clusters
Andreas Rheinhardt [Thu, 16 May 2019 22:29:58 +0000 (00:29 +0200)]
avformat/matroskadec: Remove non-incremental parsing of clusters

When the new incremental parser was introduced, the old parser was
kept, because the new parser was unable to handle the way SSA packets
are put into Matroska. But since 2014 (since c7d8dbad) this is no
longer needed, so that the old parser can be completely removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavformat/matroskadec: Use generic size check for signed integers
Andreas Rheinhardt [Thu, 16 May 2019 22:29:50 +0000 (00:29 +0200)]
avformat/matroskadec: Use generic size check for signed integers

and drop the redundant checks contained in ebml_read_uint and
ebml_read_sint.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavformat/matroskadec: Don't copy attached pictures
Andreas Rheinhardt [Thu, 16 May 2019 22:29:52 +0000 (00:29 +0200)]
avformat/matroskadec: Don't copy attached pictures

This commit replaces copying attached pictures by using references to
the already existing buffers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavformat/hlsenc: better checking var_stream_map content
Bela Bodecs [Wed, 19 Jun 2019 08:25:36 +0000 (10:25 +0200)]
avformat/hlsenc: better checking var_stream_map content

When multiple variant streams are specified by var_stream_map option,
implementation assumes that each elementary stream is assigned only once
to any variant. But this is not checked. This patch makes this checking.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Reviewed-by: Steven Liu<lq@onvideo.cn>
5 years agoavformat/vividas: reduce keybits to require half the space
Michael Niedermayer [Fri, 7 Jun 2019 21:22:13 +0000 (23:22 +0200)]
avformat/vividas: reduce keybits to require half the space

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/vividas: Fix invalid shift in decode_key()
Michael Niedermayer [Fri, 7 Jun 2019 20:56:12 +0000 (22:56 +0200)]
avformat/vividas: Fix invalid shift in decode_key()

Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 15118/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5740230004441088
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/jacosubdec: Fix timeres to 1/100 units convertion overflow
Michael Niedermayer [Fri, 7 Jun 2019 20:43:42 +0000 (22:43 +0200)]
avformat/jacosubdec: Fix timeres to 1/100 units convertion overflow

Fixes: signed integer overflow: 44444442 * 100 cannot be represented in type 'int'
Fixes: 15117/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5164660531134464
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/icodec: Free ico->images on error paths
Michael Niedermayer [Sat, 8 Jun 2019 08:48:41 +0000 (10:48 +0200)]
avformat/icodec: Free ico->images on error paths

Fixes: 15116/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5715173567889408
Fixes: memleak
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/wsddec: Fix undefined shift
Michael Niedermayer [Sat, 8 Jun 2019 07:27:49 +0000 (09:27 +0200)]
avformat/wsddec: Fix undefined shift

Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 15123/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5738039235575808
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/tiertexseq: Cleanup on error
Michael Niedermayer [Sat, 8 Jun 2019 07:25:27 +0000 (09:25 +0200)]
avformat/tiertexseq: Cleanup on error

Fixes: memleak
Fixes: 15122/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5685964636160000
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/tiertexseq: Move seq_read_close() up so it can be used for cleanup
Michael Niedermayer [Sat, 8 Jun 2019 07:24:52 +0000 (09:24 +0200)]
avformat/tiertexseq: Move seq_read_close() up so it can be used for cleanup

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/fmvc: Check if header fields are available before allocating the image
Michael Niedermayer [Sun, 2 Jun 2019 21:16:40 +0000 (23:16 +0200)]
avcodec/fmvc: Check if header fields are available before allocating the image

Fixes: Timeout (15sec -> 0.5sec)
Fixes: 14846/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FMVC_fuzzer-5068322120400896
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/wcmv: check remaining space vs. blocks
Michael Niedermayer [Sat, 1 Jun 2019 22:08:31 +0000 (00:08 +0200)]
avcodec/wcmv: check remaining space vs. blocks

Fixes: Timeout (18sec -> 7sec)
Fixes: 14835/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5646714897170432
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoffprobe: Fix memory leak
Derek Buitenhuis [Fri, 21 Jun 2019 13:34:45 +0000 (14:34 +0100)]
ffprobe: Fix memory leak

This packet was not necessarily unreferenced.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoavformat/ifv: added support for ifv cctv files
Swaraj Hota [Mon, 10 Jun 2019 03:55:27 +0000 (09:25 +0530)]
avformat/ifv: added support for ifv cctv files

Fixes ticket #2956.

Signed-off-by: Swaraj Hota <swarajhota353@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
5 years agodoc/filters: drawtext additions and corrections
greg Luce [Thu, 20 Jun 2019 16:08:04 +0000 (12:08 -0400)]
doc/filters: drawtext additions and corrections

Document the pict_type constant. Clarify availability of metadata.
Minor grammar fixes.

Written with the help of Gyan and kepstin

5 years agolibavcodec: Reduce the size of some arrays
Andreas Rheinhardt [Wed, 19 Jun 2019 02:39:47 +0000 (04:39 +0200)]
libavcodec: Reduce the size of some arrays

This commit uses smaller types for some static const arrays to reduce
their size in case the entries can be represented in the smaller type.
The biggest savings came from inv_map_table in vp9.c.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavformat/segment: fix muxing tmcd tracks in MOV
Gyan Doshi [Tue, 18 Jun 2019 13:52:16 +0000 (19:22 +0530)]
avformat/segment: fix muxing tmcd tracks in MOV

avformat/movenc still relies on AVCodecContext time_base to mux tmcd
tracks and segment muxer did not copy that field to inner streams
leading to SIGFPE in the child muxer instance.

5 years agoavformat/hlsenc: enhanced %v handling with variant names
Bodecs Bela [Thu, 20 Jun 2019 03:08:04 +0000 (11:08 +0800)]
avformat/hlsenc: enhanced %v handling with variant names

When multiple variant streams are specified by var_stream_map option, %v
placeholder in various names ensures that each variant has its unique
names. Currently %v is substituted by its variant index value (0, 1, 2
etc.). In some use cases it would be handy to specify names for variants
instead of numerical indexes. This patch makes it possible to use names
instead of default indexes. In var_stream_map option each or some of the
variant streams may use an optional name attributum (e.g.
-var_stream_map "v:0,a:0,name:sd v:1,a:1,name:720p") If a name is
specified for a variant, then this name value will be used as
substitution value of %v instead of the default index value.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@onvideo.cn>
5 years agoav_format/hlsenc: fix %v handling by format_name function
Bodecs Bela [Mon, 17 Jun 2019 21:05:21 +0000 (23:05 +0200)]
av_format/hlsenc: fix %v handling by format_name function

Hi All,

When multiple variant streams are specified by var_stream_map option, %v
placeholder in various names ensures that each variant has its unique
names. Most of %v handlng is done in format_name function. Currently
in this function the result buffer is the same as the
input pattern buffer, so you must allocate it before calling format_name
function. It also means, that it is silently assumed that the result
string will NOT be
longer that the pattern string. It is true most of the time, because %v
may appear only once in the pattern string and number of variant streams
is less than 100 in practical cases. But theoretically it will fail if
specified number of variant streams is greater than 100 (i.e. longer
than 2 digits).
This patch fixes this behaviour by altering format_name function to
allocate the
result buffer and return it to the caller.

Please, review this patch.

best,

Bela
>From 6377ebee8a106a9684d41b270c7d6c8e57cd3e7b Mon Sep 17 00:00:00 2001
From: Bela Bodecs <bodecsb@vivanet.hu>
Date: Mon, 17 Jun 2019 14:31:36 +0200
Subject: [PATCH] av_format/hlsenc: fix %v handling by format_name function

When multiple variant streams are specified by var_stream_map option, %v
placeholder in various names ensures that each variant has its unique
names. Most of %v handlng is done in format_name function. Currently
in this function the result buffer is the same as the input pattern
buffer, so you must allocate it before calling format_name function. It
also means, that it is silently assumed that the result string will NOT
be longer that the pattern string. It is true most of the time, because
%v may appear only once in the pattern string and number of variant
streams is less than 100 in practical cases. But theoretically it will
fail if specified number of variant streams is greater than 100. This
patch fixes this behaviour by altering format_name function to allocate
the result buffer and return it to the caller.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
5 years agolavfi/af_asetnsamples: Remove the redundant condition check
Jun Zhao [Sat, 15 Jun 2019 16:22:05 +0000 (00:22 +0800)]
lavfi/af_asetnsamples: Remove the redundant condition check

Redundant condition: '!A || B' is equivalent to '!A || (A && B)' but
more clearly.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agoavformat/segment: fix increment_tc
Gyan Doshi [Fri, 14 Jun 2019 17:06:27 +0000 (22:36 +0530)]
avformat/segment: fix increment_tc

inner stream avg_frame_rate wasn't populated, so tc formation failed.

Also, extended increment_tc to cover individual stream timecode.

5 years agolibavcodec/videotoolboxenc: Fix compilation broken on macOS 10.12
Limin Wang [Fri, 7 Jun 2019 15:13:26 +0000 (23:13 +0800)]
libavcodec/videotoolboxenc: Fix compilation broken on macOS 10.12

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Rick Kern <kernrj@gmail.com>
5 years agodoc/filters: correct typos in tinterlace flags
Gyan Doshi [Mon, 17 Jun 2019 11:25:57 +0000 (16:55 +0530)]
doc/filters: correct typos in tinterlace flags

5 years agodoc/filters.texi: Fix the confusing description for find_rect and cover_rect command
Limin Wang [Fri, 14 Jun 2019 16:48:24 +0000 (00:48 +0800)]
doc/filters.texi: Fix the confusing description for find_rect and cover_rect command

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavutil: add FF_DECODE_ERROR_CONCEALMENT_ACTIVE flag for AVFrame.decode_error_flags
Amir Pauker [Fri, 14 Jun 2019 14:35:44 +0000 (07:35 -0700)]
avutil: add FF_DECODE_ERROR_CONCEALMENT_ACTIVE flag for AVFrame.decode_error_flags

FF_DECODE_ERROR_CONCEALMENT_ACTIVE is set when the decoded frame has error(s) but the returned value from
avcodec_receive_frame is zero i.e. concealed errors

Signed-off-by: Amir Pauker <amir@livelyvideo.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/bink: Reorder operations in init to avoid memleak on error
Michael Niedermayer [Sat, 15 Jun 2019 19:52:24 +0000 (21:52 +0200)]
avcodec/bink: Reorder operations in init to avoid memleak on error

Fixes: Direct leak of 536 byte(s) in 1 object(s)
Fixes: 15266/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINK_fuzzer-5629530426834944
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/wtvdec: Avoid (32bit signed) sectors
Michael Niedermayer [Wed, 12 Jun 2019 23:20:19 +0000 (01:20 +0200)]
avformat/wtvdec: Avoid (32bit signed) sectors

Fixes: left shift of negative value -14614752
Fixes: 15174/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5670543606415360
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/bitstream: Check for more conflicting codes in build_table()
Michael Niedermayer [Wed, 5 Jun 2019 10:18:54 +0000 (12:18 +0200)]
avcodec/bitstream: Check for more conflicting codes in build_table()

Fixes: out of array read
Fixes: 14563/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5646451545210880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/bitstream: Check for integer code truncation in build_table()
Michael Niedermayer [Wed, 5 Jun 2019 10:18:54 +0000 (12:18 +0200)]
avcodec/bitstream: Check for integer code truncation in build_table()

Fixes: out of array read
Fixes: 14563/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5646451545210880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/sbgdec: Fixes integer overflow in str_to_time() with hours
Michael Niedermayer [Thu, 6 Jun 2019 21:20:49 +0000 (23:20 +0200)]
avformat/sbgdec: Fixes integer overflow in str_to_time() with hours

Fixes: signed integer overflow: 904444 * 3600 cannot be represented in type 'int'
Fixes: 15113/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5764083346833408
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/vpk: Check offset for validity
Michael Niedermayer [Thu, 6 Jun 2019 21:17:18 +0000 (23:17 +0200)]
avformat/vpk: Check offset for validity

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/vpk: Fix integer overflow in samples_per_block computation
Michael Niedermayer [Thu, 6 Jun 2019 21:14:13 +0000 (23:14 +0200)]
avformat/vpk: Fix integer overflow in samples_per_block computation

Fixes: signed integer overflow: 84026453 * 28 cannot be represented in type 'int'
Fixes: 15111/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5675630072430592
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agotools/target_dec_fuzzer: Also fuzz extradata
Michael Niedermayer [Wed, 5 Jun 2019 11:21:59 +0000 (13:21 +0200)]
tools/target_dec_fuzzer: Also fuzz extradata

This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agolavf/tls_gnutls: retry gnutls_handshake on non fatal errors
Remita Amine [Wed, 27 Mar 2019 12:03:07 +0000 (13:03 +0100)]
lavf/tls_gnutls: retry gnutls_handshake on non fatal errors

fixes #7801

Signed-off-by: Remita Amine <remitamine@gmail.com>
5 years agolibavfilter/vf_blend.c: remove duplicate code with macro-defined function
Limin Wang [Tue, 11 Jun 2019 06:46:16 +0000 (14:46 +0800)]
libavfilter/vf_blend.c: remove duplicate code with macro-defined function

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
5 years agolibavfilter/vf_blend.c: remove duplicate code with same function
Limin Wang [Tue, 11 Jun 2019 06:46:15 +0000 (14:46 +0800)]
libavfilter/vf_blend.c: remove duplicate code with same function

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
5 years agoavformat/dashdec: check copy_init_section memory alloc result
Steven Liu [Fri, 14 Jun 2019 08:59:07 +0000 (16:59 +0800)]
avformat/dashdec: check copy_init_section memory alloc result

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agolavf/hls: More log message
Jun Zhao [Fri, 14 Jun 2019 01:22:04 +0000 (09:22 +0800)]
lavf/hls: More log message

More log message, it's will help the debugging

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agodoc/fftools-common-opts: document ffmpeg -h bsf=bitstream_filter_name
Jun Zhao [Sat, 8 Jun 2019 14:52:47 +0000 (22:52 +0800)]
doc/fftools-common-opts: document ffmpeg -h bsf=bitstream_filter_name

document ffmpeg -h bsf=bitstream_filter_name

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agodoc/formats: document f_strict/strict for AVFormatContext
Jun Zhao [Sat, 8 Jun 2019 12:07:44 +0000 (20:07 +0800)]
doc/formats: document f_strict/strict for AVFormatContext

document f_strict/strict option for AVFormatContext

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agolavf/webvtt: fix ffmpeg -h demuxer=webvtt can't dump options
Jun Zhao [Tue, 4 Jun 2019 02:54:45 +0000 (10:54 +0800)]
lavf/webvtt: fix ffmpeg -h demuxer=webvtt can't dump options

fix ffmpeg -h demuxer=webvtt can't dump options

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agoavformat/hls: add http 2.0 version number compare for the http_multiple
Steven Liu [Tue, 4 Jun 2019 07:58:35 +0000 (15:58 +0800)]
avformat/hls: add http 2.0 version number compare for the http_multiple

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/hls: avformat_find_stream_info when the audio list in the variant
Steven Liu [Tue, 4 Jun 2019 07:27:11 +0000 (15:27 +0800)]
avformat/hls: avformat_find_stream_info when the audio list in the variant

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/dashdec: add http_proxy, referer and rw_timeout http method support for...
Steven Liu [Mon, 3 Jun 2019 09:03:41 +0000 (17:03 +0800)]
avformat/dashdec: add http_proxy, referer and rw_timeout http method support for segments

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agoavformat/hlsenc: add EXT-X-I-FRAMES-ONLY tag support
Steven Liu [Sun, 2 Jun 2019 14:03:17 +0000 (22:03 +0800)]
avformat/hlsenc: add EXT-X-I-FRAMES-ONLY tag support

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
5 years agolavf/qsv_vpp: add frame format option
Zhong Li [Fri, 31 May 2019 00:44:47 +0000 (08:44 +0800)]
lavf/qsv_vpp: add frame format option

1. Currently output format is hard-coded as NV12, thus means
   CSC is always done for not NV12 input such as P010.
   Follow original input format as default output.
2. Add an option to specify output format.

Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agoavformat/id3v2enc: fix bug, CTOC flags take only one byte
Paul B Mahol [Thu, 13 Jun 2019 21:11:10 +0000 (23:11 +0200)]
avformat/id3v2enc: fix bug, CTOC flags take only one byte

5 years agoavcodec/mediacodecdec: re-indent after previous commit
Matthieu Bouron [Wed, 24 Apr 2019 07:59:30 +0000 (09:59 +0200)]
avcodec/mediacodecdec: re-indent after previous commit

5 years agoavcodec/mediacodecdec: remove unneeded else block in ff_mediacodec_dec_send()
Matthieu Bouron [Wed, 24 Apr 2019 07:59:29 +0000 (09:59 +0200)]
avcodec/mediacodecdec: remove unneeded else block in ff_mediacodec_dec_send()

5 years agoavcodec/mediacodecdec: try to receive a frame after signaling EOF to the codec
Matthieu Bouron [Wed, 24 Apr 2019 07:59:28 +0000 (09:59 +0200)]
avcodec/mediacodecdec: try to receive a frame after signaling EOF to the codec

Avoids returning EAGAIN after signaling EOF to the codec in
ff_mediacodec_dec_send() so we can try to receive a frame before
returning in mediacodec_receive_frame().

This helps avoiding an extra round-trip between avcodec_send_frame() and
avcodec_receive_frame() while draining the remaining frames.

5 years agoavcodec/omx: Correct av_log() log message
Alejandro Solozabal [Wed, 12 Jun 2019 12:16:25 +0000 (12:16 +0000)]
avcodec/omx: Correct av_log() log message

Print the right library name, which is trying to open, on the log message.

Signed-off-by: Alejandro Solozabal <a.solozabal@hotmail.com>
5 years agovaapi_encode_mjpeg: fix bad component id bug
U. Artie Eoff [Fri, 7 Jun 2019 21:45:33 +0000 (14:45 -0700)]
vaapi_encode_mjpeg: fix bad component id bug

The compound literals assigned to "components"
only exist within the scope of the if/else
block (thanks Mark Thompson for the better
explanation).

Thus, after this if/else block, "components"
ends up pointing to an arbitrary/undefined
array.  With some compilers and depending on
optimization settings, these arbitrary values
may end up being the same value (i.e. 0 with
GNU GCC 9.x).  Unfortunately, the GNU GCC
compiler, at least, never prints any warnings
about this.

This patch fixes this issue by assigning the
constant arrays to local variables at function
scope and then pointing "components" to those
as necessary.

Fixes #7915

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
5 years agoavfilter/vf_gblur: add missing preprocessor check
James Almer [Wed, 12 Jun 2019 13:54:59 +0000 (10:54 -0300)]
avfilter/vf_gblur: add missing preprocessor check

Fixes compilation on x86_32

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoconfigure: add missing dnn dependency to derain filter
James Almer [Wed, 12 Jun 2019 13:27:35 +0000 (10:27 -0300)]
configure: add missing dnn dependency to derain filter

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agofate: add VP4 test
Peter Ross [Tue, 14 May 2019 13:25:50 +0000 (23:25 +1000)]
fate: add VP4 test

5 years agoavformat/riff: add VP4 fourcc
Peter Ross [Fri, 11 Jan 2019 23:30:02 +0000 (10:30 +1100)]
avformat/riff: add VP4 fourcc

5 years agoVP4 video decoder
Peter Ross [Sun, 6 Jan 2019 06:45:04 +0000 (17:45 +1100)]
VP4 video decoder

5 years agoavcodec/vp3: spin off get_eob_run and get_coeff coeff functions
Peter Ross [Sat, 8 Jun 2019 00:55:51 +0000 (10:55 +1000)]
avcodec/vp3: spin off get_eob_run and get_coeff coeff functions

these reoutines are shared by vp3 and vp4.

5 years agoavcodec/mjpegdec: Check for non ls PAL8
Michael Niedermayer [Sat, 1 Jun 2019 17:06:07 +0000 (19:06 +0200)]
avcodec/mjpegdec: Check for non ls PAL8

Fixes: Null-dereference READ in av_malloc
Fixes: 15002/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5643474625363968
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/v4l2_m2m_dec: Fix memleak on ff_v4l2_m2m_codec_init() failure
Michael Niedermayer [Sat, 1 Jun 2019 14:44:46 +0000 (16:44 +0200)]
avcodec/v4l2_m2m_dec: Fix memleak on ff_v4l2_m2m_codec_init() failure

Fixes: 13579/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1_V4L2M2M_fuzzer-5753560726241280
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agotests/ref/fate/nuv-rtjpeg: Preserve the original timestamps
Michael Niedermayer [Thu, 30 May 2019 13:02:07 +0000 (15:02 +0200)]
tests/ref/fate/nuv-rtjpeg: Preserve the original timestamps

The tests previously rounded the timestamps. Its better in a fate test to preserve
the data from the demuxer and decoder.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/interplayvideo: check decoding_map_size with video_data_size
Michael Niedermayer [Sun, 26 May 2019 21:18:34 +0000 (23:18 +0200)]
avcodec/interplayvideo: check decoding_map_size with video_data_size

Fixes: Timeout (90543 ms -> 59 ms)
Fixes: 14721/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer-5697492148027392
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/h264_parse: Use 64bit for expectedpoc and expected_delta_per_poc_cycle
Michael Niedermayer [Thu, 23 May 2019 21:17:35 +0000 (23:17 +0200)]
avcodec/h264_parse: Use 64bit for expectedpoc and expected_delta_per_poc_cycle

Fixes: signed integer overflow: -2142516591 + -267814575 cannot be represented in type 'int'
Fixes: 14450/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5716105319940096
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agocheckasm/vf_gblur: add test for horiz_slice simd
Ruiling Song [Tue, 4 Jun 2019 08:34:08 +0000 (16:34 +0800)]
checkasm/vf_gblur: add test for horiz_slice simd

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
5 years agoavfilter/vf_gblur: add x86 SIMD optimizations
Ruiling Song [Wed, 15 May 2019 09:54:10 +0000 (17:54 +0800)]
avfilter/vf_gblur: add x86 SIMD optimizations

The horizontal pass get ~2x performance with the patch
under single thread.

Tested overall performance using the command(avx2 enabled):
./ffmpeg -i 1080p.mp4 -vf gblur -f null /dev/null
./ffmpeg -i 1080p.mp4 -vf gblur=threads=1 -f null /dev/null
For single thread, the fps improves from 43 to 60, about 40%.
For multi-thread, the fps improves from 110 to 130, about 20%.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
5 years agolibavfilter/vf_cover_rect.c: free the allocated frame
Limin Wang [Tue, 11 Jun 2019 01:45:58 +0000 (09:45 +0800)]
libavfilter/vf_cover_rect.c: free the allocated frame

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavfilter/vf_normalize: fix filtering of RGB0 formats
Paul B Mahol [Mon, 10 Jun 2019 20:58:45 +0000 (22:58 +0200)]
avfilter/vf_normalize: fix filtering of RGB0 formats

5 years agoavformat/nut: add cpia codec
Stephan Hilb [Thu, 6 Jun 2019 20:31:44 +0000 (22:31 +0200)]
avformat/nut: add cpia codec

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agolavf/qsvvpp: add P010 output format support
Zhong Li [Fri, 31 May 2019 00:44:48 +0000 (08:44 +0800)]
lavf/qsvvpp: add P010 output format support

Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agolavf/qsvvpp: add extra_hw_frames support
Zhong Li [Wed, 5 Jun 2019 08:56:27 +0000 (16:56 +0800)]
lavf/qsvvpp: add extra_hw_frames support

extra_hw_frames is needed for some cases.
(eg: qsv decoding + qsv vpp + qsv look_ahead encoding, transcoding
 failed if no extra_hw_frames supported:
 ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal_2000frames.mp4 \
-vf vpp_qsv=w=1280:h=720:extra_hw_frames=100 -v verbose  -c:v h264_qsv \
-look_ahead 1 -look_ahead_depth 100 out1.mp4
)

Signed-off-by: Zhong Li <zhong.li@intel.com>
5 years agofate: add dst decoder test
Peter Ross [Mon, 24 Dec 2018 09:09:46 +0000 (20:09 +1100)]
fate: add dst decoder test

5 years agoavfilter/vf_lut2: add slice threading
Paul B Mahol [Sun, 9 Jun 2019 12:07:00 +0000 (14:07 +0200)]
avfilter/vf_lut2: add slice threading

5 years agoavcodec/vp3data: combine eob_run_base and eob_run_get_bits tables
Peter Ross [Fri, 24 May 2019 10:10:32 +0000 (20:10 +1000)]
avcodec/vp3data: combine eob_run_base and eob_run_get_bits tables

5 years agocbs_av1, cbs_jpeg, cbs_mpeg2, cbs_vp9: Fix undef
Andreas Rheinhardt [Fri, 7 Jun 2019 00:27:11 +0000 (02:27 +0200)]
cbs_av1, cbs_jpeg, cbs_mpeg2, cbs_vp9: Fix undef

READ has already been undefined at this point; it is obviously intended
to undef WRITE.
Furthermore, leb128 (in cbs_av1) was undefined too often and
inconsistently.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agolavfi/vaapi: Fix build with libva 2.1 and 2.2
Mark Thompson [Fri, 7 Jun 2019 20:15:29 +0000 (21:15 +0100)]
lavfi/vaapi: Fix build with libva 2.1 and 2.2

While the VAProcColorProperties structure was added in libva 2.1, the
colour primaries/transfer/space fields were not added until libva 2.3.

5 years agoavformat/matroskadec: Compactify structure
Andreas Rheinhardt [Thu, 16 May 2019 22:29:47 +0000 (00:29 +0200)]
avformat/matroskadec: Compactify structure

Matroska EBML IDs can be only four bytes long maximally, so it is
natural to use uint32_t for them. By doing this and rearranging the
elements of the MatroskaLevel1Element structure, one can reduce the size
of said structure.

Notice that this field is not read via the generic reading process for
EBML_UINT, so one is not forced to use an uint64_t for it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/matroskadec: Correct outdated error message
Andreas Rheinhardt [Thu, 16 May 2019 22:29:46 +0000 (00:29 +0200)]
avformat/matroskadec: Correct outdated error message

This error message is outdated since d31fb1a9.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/matroskadec: Remove unused variables
Andreas Rheinhardt [Thu, 16 May 2019 22:29:45 +0000 (00:29 +0200)]
avformat/matroskadec: Remove unused variables

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/id3v2enc: write CTOC too
Paul B Mahol [Tue, 4 Jun 2019 14:44:19 +0000 (16:44 +0200)]
avformat/id3v2enc: write CTOC too

5 years agolavf/hls: Update av_log() log message
Jun Zhao [Sat, 1 Jun 2019 10:45:35 +0000 (18:45 +0800)]
lavf/hls: Update av_log() log message

Pass correct pointer to av_log() and update some error/warning message,
it's will help the debugging

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
5 years agolibavfilter: Add derain filter
Xuewei Meng [Thu, 30 May 2019 12:35:17 +0000 (20:35 +0800)]
libavfilter: Add derain filter

Remove the rain in the input image/video by applying the derain
methods based on convolutional neural networks. Training scripts
as well as scripts for model generation are provided in the
repository at https://github.com/XueweiMeng/derain_filter.git.

Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
5 years agoavfilter/framesync: fix shortest with eof_action=pass
Gyan Doshi [Wed, 5 Jun 2019 14:22:04 +0000 (19:52 +0530)]
avfilter/framesync: fix shortest with eof_action=pass

Shifted check of shortest to after repeatlast,
to ensure shortest=1 is always honoured.

5 years agoavcodec/mss4: Check input size against skip bits
Michael Niedermayer [Tue, 14 May 2019 12:29:43 +0000 (14:29 +0200)]
avcodec/mss4: Check input size against skip bits

Fixes: Timeout (17sec -> 20ms)
Fixes: 14615/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MTS2_fuzzer-5093007763701760
Fixes: 14797/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MTS2_fuzzer-5651696119709696
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/dxv: Check op_offset in dxv_decompress_cocg()
Michael Niedermayer [Mon, 20 May 2019 23:33:03 +0000 (01:33 +0200)]
avcodec/dxv: Check op_offset in dxv_decompress_cocg()

Fixes: signed integer overflow: -2147483648 - 12 cannot be represented in type 'int'
Fixes: 14732/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5735273129836544
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/diracdec: Fix integer overflow in global_mv()
Michael Niedermayer [Wed, 22 May 2019 00:01:33 +0000 (02:01 +0200)]
avcodec/diracdec: Fix integer overflow in global_mv()

Fixes: signed integer overflow: 16384 * 196607 cannot be represented in type 'int'
Fixes: 14810/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5091232683917312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agotools/target_dec_fuzzer: Limit error concealment on pixels instead of just frames
Michael Niedermayer [Thu, 16 May 2019 22:23:54 +0000 (00:23 +0200)]
tools/target_dec_fuzzer: Limit error concealment on pixels instead of just frames

This should reduce the amount of timeout issues overall

Fixes: Timeout (34->10sec)
Fixes: 14682/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5728608414334976
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agobitstream_filters: Correct dump_extradata description
Andreas Rheinhardt [Tue, 4 Jun 2019 13:41:05 +0000 (15:41 +0200)]
bitstream_filters: Correct dump_extradata description

The default is to dump extradata to keyframes, not all frames.
Also improve the description of the relevant AVOption.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
5 years agoavcodec/vmnc: Check available space against chunks before reget_buffer()
Michael Niedermayer [Fri, 17 May 2019 21:28:49 +0000 (23:28 +0200)]
avcodec/vmnc: Check available space against chunks before reget_buffer()

Fixes: Timeout (16sec -> 60ms)
Fixes: 14673/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMNC_fuzzer-5640217517621248
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/pafvideo: Clear frame buffer later
Michael Niedermayer [Fri, 17 May 2019 20:27:38 +0000 (22:27 +0200)]
avcodec/pafvideo: Clear frame buffer later

This way the clearing can be skipped in case of some errors.

Fixes: Timeout (11sec -> 344ms)
Fixes: 14670/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAF_VIDEO_fuzzer-5769534503387136
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/aacdec_template: skip apply_tns() if max_sfb is 0 (from previous header decod...
Michael Niedermayer [Sat, 18 May 2019 08:37:26 +0000 (10:37 +0200)]
avcodec/aacdec_template: skip apply_tns() if max_sfb is 0 (from previous header decode failure)

Fixes: NULL pointer dereference
Fixes: 14723/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5654612436058112
Fixes: 14724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5712607111020544
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/arbc: Skip tiles in fill_tileX() which are completely outside
Michael Niedermayer [Thu, 9 May 2019 21:49:41 +0000 (23:49 +0200)]
avcodec/arbc: Skip tiles in fill_tileX() which are completely outside

Fixes: signed integer overflow: 2052526848 + 147237888 cannot be represented in type 'int'
Fixes: 14441/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARBC_fuzzer-5717632944177152
Fixes: 14453/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARBC_fuzzer-5739679254577152
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/aacdec_fixed: Handle more extreem cases in noise_scale()
Michael Niedermayer [Thu, 16 May 2019 10:00:18 +0000 (12:00 +0200)]
avcodec/aacdec_fixed: Handle more extreem cases in noise_scale()

Its unclear if these cases have any relevance in real files

Fixes: shift exponent -2 is negative
Fixes: 14489/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5681941631729664
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/aacdec_template: Merge 3 #ifs related to noise handling
Michael Niedermayer [Thu, 16 May 2019 09:55:43 +0000 (11:55 +0200)]
avcodec/aacdec_template: Merge 3 #ifs related to noise handling

Fewer #if and fewer lines

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>