Commit Graph

100047 Commits

Author SHA1 Message Date
Andreas Rheinhardt
e246ea2535 avcodec/motionpixels: Only create VLC iff it is going to be used
If the Huffman tree consists of only one entry (which has length zero),
no tree is used at all for parsing as the VLC API currently can't handle
this. So it makes no sense to create a VLC in this case.

Commit 41b7389cad added a check for
whether creating the VLC should be skipped, but it also skipped decoding
the packet and it used the wrong check: It checked max_codes_bits,
the maximum length of a code; but this value is only updated iff there is
more than one Huffman entry. So if there is only one Huffman entry, and
there was a previous frame with more than one entry, then a VLC was
created unnecessarily; yet if there was no previous frame with more than
one entry, then this frame will be skipped which is probably
spec-incompliant. I have no sample for the latter.

This commit improves the check to create a VLC iff it is going to be
used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
97da1b4341 avcodec/mimic: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
3066b243e9 avcodec/mimic: Cleanup generically upon init failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
e9d06fef62 avcodec/rv10: Make initializing static RV10 VLCs thread-safe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
1463f9edcb avcodec/smacker: Mark decoders as init-threadsafe
Both Smacker audio and video decoders don't use/modify any global state.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt
a6423412c1 avcodec/tscc2: Mark tscc2 decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:02 +01:00
Paul B Mahol
68429b9465 avfilter/af_adenorm: add timeline and slice threading support 2020-11-24 11:32:19 +01:00
Paul B Mahol
ee8ecc2730 avfilter/af_asubboost: add timeline and slice threading support 2020-11-24 10:19:04 +01:00
Jean-Baptiste Kempf
052a5993ad avcodec: add SpeedHQ encoder 2020-11-24 09:38:35 +01:00
Jan Ekström
4688017d9a avformat/av1: add support for passing through MP4/Matroska av1c 2020-11-24 10:13:55 +02:00
Jan Ekström
8fbc139e61 avcodec/av1{dec,parser}: move to ff_cbs_read_extradata_from_codec
This lets us re-utilize the extradata-related checks in the CBS
to add support for passing the AV1CodecConfigurationRecord
as extradata as-is without further filtering.
2020-11-24 10:13:55 +02:00
Jan Ekström
a66d1779bb avcodec/cbs_av1: add support for standard MP4/Matroska extradata
This way API clients can just pass the AV1CodecConfigurationRecord
as extradata as-is without further filtering.
2020-11-24 10:13:55 +02:00
Mark Thompson
7bacf60ae5 cbs: Add function to read extradata from an AVCodecContext
This is useful in decoders and parsers, matching the way that bitstream
filters read extradata from AVCodecParameters.
2020-11-24 10:13:55 +02:00
Limin Wang
01eb05207c avdevice/decklink_dec: fix warning for unused variable
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-23 16:18:57 +08:00
Limin Wang
3d0a7ae460 avdevice/decklink: add AV_OPT_FLAG_DEPRECATED flag for list_devices
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-23 16:18:57 +08:00
Limin Wang
ae23a9684d avdevice/decklink: use boolean for list_devices option
For the document(indevs.texi and outdevs.texi) used it as boolean.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-23 16:18:57 +08:00
Paul B Mahol
9208b72a38 avfilter/af_aiir: add support for arbitrary order lattice-ladder filter format 2020-11-22 22:57:43 +01:00
Michael Niedermayer
b0a8b40294 avcodec/exr: skip bottom clearing loop when its outside the image
Fixes: signed integer overflow: 1633771809 * 32960 cannot be represented in type 'int'
Fixes: 26532/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5613925708857344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-22 17:45:17 +01:00
Michael Niedermayer
3e5959b345 avcodec/exr: Check ymin vs. h
Fixes: out of array access
Fixes: 26532/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5613925708857344
Fixes: 27443/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5631239813595136

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-22 17:45:17 +01:00
Michael Niedermayer
1278f117d7 avformat/avs: Use 64bit for the avio_tell() output
Fixes: signed integer overflow: 9223372036854775807 - -1 cannot be represented in type 'long'
Fixes: 26549/clusterfuzz-testcase-minimized-ffmpeg_dem_AVS_fuzzer-4844306424397824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-22 17:45:17 +01:00
Michael Niedermayer
40348637be avformat/moflex: Check pkt_size
Fixes: Timeout (>20sec -> 1ms)
Fixes: 26527/clusterfuzz-testcase-minimized-ffmpeg_dem_MOFLEX_fuzzer-6308307310215168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-22 17:45:17 +01:00
Paul B Mahol
42ccef2846 avfilter/af_biquads: remove not needed code 2020-11-22 14:22:19 +01:00
Leo Izen
f5dcaf2daa avformat/movenc: allow Apple Lossless inside mp4
The 'alac' identifier has been registered to ISO and thus towards
ISOBMFF at the MP4 registration authority. The existing non-MOV
mux mode matches the official ALAC-in-MP4 specification.
2020-11-22 14:28:31 +02:00
Paul B Mahol
0066bf4d1a avfilter/af_afreqshift: add timeline and slice threading support 2020-11-22 10:46:18 +01:00
Paul B Mahol
d29a9b8891 avcodec/atrac3: increase max block align size
Fixes decoding of lossy part of advanced lossless atrac3.
Regression since f09151fff9
2020-11-21 22:13:10 +01:00
Michael Niedermayer
a108a4d809 avcodec/mobiclip: Check mv against INT_MAX
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 27369/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-5083469356728320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-21 22:09:51 +01:00
Michael Niedermayer
a207df2acb avformat/wavdec: More complete size check in find_guid()
Fixes: signed integer overflow: 9223372036854775807 + 8 cannot be represented in type 'long'
Fixes: 27341/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5442833206738944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-21 22:09:51 +01:00
Michael Niedermayer
2eb6417417 avcodec/mv30: Use unsigned in idct_1d()
Fixes: signed integer overflow: 2110302399 + 39074947 cannot be represented in type 'int'
Fixes: 27330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5664923153334272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-21 22:09:51 +01:00
Michael Niedermayer
8b50e8bc29 avformat/iff: Check size before skip
Fixes: Infinite loop
Fixes: 27292/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5731168991051776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-21 22:09:51 +01:00
Michael Niedermayer
ebf4bc629e avformat/rmdec: Check for EOF in index packet reading
Fixes: Timeout(>10sec -> 1ms)
Fixes: 27284/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-6304211110985728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-21 22:09:51 +01:00
leozhang
7ce7d33d15 avcodec/cuviddec: fix missing context push/pop
Test command like below:
cuda-memcheck ./ffmpeg -hwaccel cuvid -c:v h264_cuvid -i input_file -c:v h264_nvenc -f null -

Signed-off-by: leozhang <nowerzt@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-11-21 21:56:51 +01:00
Andriy Gelman
4fe9e2fc16 avformat/rtsp: don't forget to call ff_network_close() on error
In sdp_read_header() some ff_network_close() calls were missed.

Also in rtp_read_header() update comment to explain why a single
call to ff_network_close() is enough to cover all cases even if
sdp_read_header() returns an error.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-11-21 10:15:52 -05:00
Andriy Gelman
78537aa52f avformat/rtsp: set return variable in error path
In this error path ret still stores the number of bytes read in
ffurl_read().

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-11-21 10:15:46 -05:00
Andriy Gelman
9a70b6f5b8 avformat/rtspdec: cosmetics
Make error check style consistent with rest of function.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-11-21 10:13:36 -05:00
Andriy Gelman
122fcf1f40 avformat/rtspdec: fix mem leaks in connect mode if init fails
Fixes #6334

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-11-21 10:13:28 -05:00
Andriy Gelman
38bc4ba142 avformat/rtspdec: fix mem leaks in listen mode if init fails
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-11-21 10:13:16 -05:00
Andriy Gelman
423d06e0e2 avformat/rtspdec: add network init to listen mode
As per the docs network initialization is required before ff_url_join().
Furthermore, because the ff_network_init() was skipped, this makes
one additional call to ff_network_close() if the stream exits without
errors.

The was forgotten in the origin commit of the listen mode:
a8ad6ffafe

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-11-21 10:11:38 -05:00
Limin Wang
09f1d15ae8 avdevice/decklink_dec: map the raw_format instead of hardcode
The patch will change the numerical values for the string constants so bump
micro version.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-21 09:14:52 +08:00
James Almer
c055a476b2 tools/target_bsf_fuzzer: set bitstream filter options
Should increase coverage with some bitstream filters

Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-20 19:20:33 -03:00
James Almer
837eb320b8 tools/target_bsf_fuzzer: Call av_bsf_flush() in a fuzzer choosen pattern
This should increase coverage.

Based on a commit by Michael Niedermayer

Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-20 12:43:51 -03:00
Michael Niedermayer
cb59cd3466 tools/target_dec_fuzzer: Call avcodec_flush_buffers() in a fuzzer choosen pattern
This should increase coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-20 12:43:51 -03:00
James Almer
40dfb4328d tools/target_dem_fuzzer: use avio_context_free() to free the fuzzer's AVIOContext
The doxy for avio_alloc_context() states it must be used for this.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-20 12:43:51 -03:00
Anton Khirnov
8918a3dfa2 lavfi/src_movie: switch to new decoding API 2020-11-20 15:25:26 +01:00
Anton Khirnov
ce0f5397a8 doc/examples/transcoding: switch to the new encoding API 2020-11-20 15:20:24 +01:00
Anton Khirnov
29f33c1076 doc/examples/transcoding: stop constantly allocating AVFrames
Allocate just one and reuse it.
2020-11-20 15:20:24 +01:00
Anton Khirnov
800feae5d6 lavu: add missing stddef.h includes for size_t. 2020-11-20 15:20:24 +01:00
Anton Khirnov
e1c4a3ea7d lavfi/lavfutils: switch to the new decoding API 2020-11-20 15:20:24 +01:00
Anton Khirnov
65c4d5d72e tools/enum_options: fix build and add to Makefile 2020-11-20 15:20:24 +01:00
Steve Lhomme
5bd870a212 avformat/matroskadec: only use the track duration if it exists
No need to multiplying/dividing when we know it's zero.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-11-20 15:20:24 +01:00
Steve Lhomme
3a2b786db0 avformat/matroskadec: adjust the cluster time to the track timebase
The Block timestamp read in matroska_parse_block() is in track timebase and is
passed on as such to the AVPacket which uses this timebase.

In the normal case the Cluster and Track timebases are the same because the
track->time_scale is 1.0. But when it is not the case, the values in Cluster
timebase need to be transformed in Track timebase so they can be added
together.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-11-20 15:20:24 +01:00