1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00
Commit Graph

92489 Commits

Author SHA1 Message Date
Michael Niedermayer
c22b67feaa avcodec/rpza: Check that there is enough data for all the blocks
Fixes: Timeout
Fixes: 11547/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RPZA_fuzzer-5678435842654208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e63517e00a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
4c0be3a60c avcodec/rpza: Move frame allocation to a later point
This will allow performing some fast checks before the slow allocation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8a708aa99c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
42357b37cb avcodec/avcodec: Document the data type for AV_PKT_DATA_MPEGTS_STREAM_ID
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 68e011e410)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
e3fbbb7d18 avformat/mpegts: Fix side data type for stream id
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ab1319d82f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
2f75965c47 tests/fate/filter-video: increase fuzz for fate-filter-refcmp-psnr-rgb
Fixes: test failure on powerpc

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f8f762c300)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
e1f40f0dae avcodec/mjpegdec: Fix indention of ljpeg_decode_yuv_scan()
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ea30ac1e40)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
chcunningham
45f5f2086e lavf/id3v2: fail read_apic on EOF reading mimetype
avio_read may return EOF, leaving the mimetype array unitialized. fail
early when this occurs to avoid using the array in an unitialized state.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ee1e39a576)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
321c418b87 avcodec/rasc: Check that the number of moves is less than or equal the number of pixels
Fixes: OOM
Fixes: 10307/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5393974559244288

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>
(cherry picked from commit 092cb17983)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
f5859d4a8e avformat/nutenc: Document trailer index assert better
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3a95b73abc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
chcunningham
54fbdacc37 lavf/mov: ensure only one tkhd per trak
Chromium fuzzing produced a whacky file with extra tkhds. This caused
an AVStream that was already in use to be corrupted by assigning it a
new id, which blows up later in mov_read_trun because the
MOVFragmentStreamInfo.index_entry now points OOB.

Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c9f7b6f7a9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
228f17ced3 avcodec/clearvideo: Check remaining input bits in P macro block loop
Fixes: Timeout
Fixes: 11083/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CLEARVIDEO_fuzzer-5657180351496192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7aaab127be)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
9b5a6bb67b avcodec/rasc: Check input space before reading chunk
Fixes: Timeout
Fixes: 11118/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5652564066959360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 52ba824c65)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
219cbc5527 avcodec/dxv: Check that there is enough data to decompress
Fixes: Timeout
Fixes: 10979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-6178582203203584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2bc3811c0d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
55c36d2498 avcodec/ppc/hevcdsp: Fix build failures with powerpc-linux-gnu-gcc-4.8 with --disable-optimizations
The affected functions could also be changed into macros, this is the
smaller change to fix it though. And avoids (probably) less readable macros
The extra code should be optimized out when optimizations are done as all values
are known at build after inlining.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2c64a6bcd2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
558ba71de5 avcodec/msvideo1: Check for too small dimensions
Such low resolution would result in empty output as a minimum of 4x4 is needed
We could also check for multiple of 4 dimensions but that is not needed

Fixes: Timeout
Fixes: 11191/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSVIDEO1_fuzzer-5739529588178944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 953bd58861)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
1a5db666ac avcodec/wmv2dec: Skip I frame if its smaller than 1/8 of the minimal size
Frames that small are not valid and of limited use for error concealment, while
being very computationally intensive to process.

Fixes: Timeout
Fixes: 11168/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5733782032744448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d6f4341522)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
eee0cf487a avcodec/msmpeg4dec: Skip frame if its smaller than 1/8 of the minimal size
Frames that small are not valid and of limited use for error concealment, while
being very computationally intensive to process.

Fixes: Timeout
Fixes: 11318/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSMPEG4V1_fuzzer-5710884555456512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 09ec182864)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
90db1e441f avcodec/truemotion2rt: Fix rounding in input size check
Fixes: Timeout
Fixes: 11332/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2RT_fuzzer-5678456612847616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7f22a4ebc9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
4fe90900d8 avcodec/diracdec: Check component quant
Fixes: Timeout
Fixes: 10708/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5730140957442048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 28c96c2ce2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:26 +01:00
Michael Niedermayer
ee349bd0fd avcodec/tiff: Limit filtering to decoded data
Fixes: Timeout
Fixes: 11068/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5698456681709568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 90ac0e5f29)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:25 +01:00
Michael Niedermayer
ab744447e1 avcodec/truemotion2: fix integer overflows in tm2_low_chroma()
Fixes: 11295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-4888953459572736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2ae39d7956)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:25 +01:00
Michael Niedermayer
89d65915cf avcodec/pngdec: Check compression method
method 0 (inflate/deflate) is the only specified in the specification and the only supported

Fixes: Timeout
Fixes: 10976/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PNG_fuzzer-5729372588736512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1f99674ddd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:25 +01:00
Michael Niedermayer
e69bb0fb05 fftools/ffmpeg: Repair reinit_filter feature
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3504004879)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:25 +01:00
Michael Niedermayer
98a9d868d1 avcodec/shorten: Fix integer overflow with offset
Fixes: signed integer overflow: -1625810908 - 582229060 cannot be represented in type 'int'
Fixes: 10977/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5732602018267136

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2f888771cd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:25 +01:00
Michael Niedermayer
b66152a4e5 avcodec/imm4: Use ff_set_dimensions()
Fixes: Out of memory
Fixes: 10970/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IMM4_fuzzer-5698750043914240

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c305e134ce)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:25 +01:00
Andreas Rheinhardt
ac50246cc4 h264_redundant_pps: Fix logging context
The first element of H264RedundantPPSContext is not a pointer to an
AVClass as required.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6dafcb6fdb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-21 07:53:25 +01:00
Marton Balint
ddc284300e avfilter/af_asetnsamples: fix last frame props
Frame properties were not copied, so e.g. PTS was not set for the last frame.

Regression since ef3babb2c7.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit f9e947845f)
2019-01-01 20:39:44 +01:00
Mark Thompson
b420f23566 cbs_av1: Fix reading of overlong uvlc codes
The specification allows 2^32-1 to be encoded as any number of zeroes
greater than 31, followed by a one.  This previously failed because the
trace code would overflow the array containing the string representation
of the bits if there were more than 63 zeroes.  Fix that by splitting the
trace output into batches, and at the same time move it out of the default
path.

(While this seems likely to be a specification error, libaom does support
it so we probably should as well.)

From a test case by keval shah <skeval65@gmail.com>.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b97a4b6588)
2018-12-22 18:28:41 +00:00
James Almer
5356e61001 avcodec/cbs_av1: fix parsing delta_frame_id_minus1
delta_frame_id_minus1 is not a single value in the bitstream, and can
store values up to 17 bits wide.

Fixes parsing files with frame ids.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 064f9505f4)
2018-12-20 18:29:42 -03:00
Paul B Mahol
a4ddc3c9fc avfilter/vf_overlay: fix filtering with negative y
(cherry picked from commit 8440835dbe)
2018-12-14 23:56:21 +01:00
Paul B Mahol
59e30c05d7 avformat/movenc: get number of written bytes from bitstream writer
Update fate test.

(cherry picked from commit 97d1ee437b)
2018-11-26 15:36:12 +01:00
Paul B Mahol
fcffed470a avformat/movenc: fix size calculation in mov_write_eac3_tag()
Otherwise it would assert when flushing bits.

(cherry picked from commit 027f032bbc)
2018-11-26 15:36:05 +01:00
Paul B Mahol
9efc591cb7 avfilter/vf_overlay: fix crash with negative y
(cherry picked from commit 57815cfad5)
2018-11-25 12:46:56 +01:00
Marton Balint
d4c5f515f0 avcodec/mpeg_er: fix clearing chroma blocks for 422 and 444
Fixes ticket #7494.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit e3a9630982)
2018-11-19 23:29:30 +01:00
Marton Balint
bb01cd3cc0 avfilter/af_afade: fix duration maximum
Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit aecd63b926)
2018-11-15 22:34:53 +01:00
Mark Harris
fed94c2f22 avfilter/vf_fade: fix start/duration max value
A fade out (usually at the end of a video) can easily start beyond
INT32_MAX (about 36 minutes).  Regression since d40dc64173.

(cherry picked from commit ae4323548a)
2018-11-15 22:34:34 +01:00
James Almer
a9e9303f26 avcodec/cbs_av1: fix parsing signed integer values
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit f0f2832a5c)
2018-11-14 20:53:44 -03:00
James Almer
49bc641e89 avcodec/cbs_av1: fix storage size for segmentation_params feature_value fields
The valid range is -255 to 255.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 79831f4531)
2018-11-14 20:53:40 -03:00
Mark Thompson
4f1e07090a configure: Add missing xlib dependency for VAAPI X11 code
Fixes #7538.

(cherry picked from commit 2ce3a48f30)
2018-11-14 23:24:51 +00:00
Mark Wu
11dff170ef avcodec/hevcdec: fix non-ref frame judgement
After inspecting the source code of x265, mpv and ffmpeg, I've found that
ffmpeg mistakenly regards EVC_NAL_BLA_N_LP and HEVC_NAL_IDR_N_LP as non-
reference frames, which are acutally reference frames according to the
specification in x265, and drops them.

This patch should address the problem. I have tested it with mpv.

Signed-off-by: Mark Wu <wfwf1997@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 10bc4c3a7d)
2018-11-10 14:38:25 -03:00
Mark Thompson
10506de9ad cbs_av1: Support redundant frame headers
(cherry picked from commit f5894178fb)
2018-11-05 23:11:03 +00:00
Mark Thompson
af3fccfeff cbs_av1: Fix header writing when already aligned
(cherry picked from commit 6bdb7712ae)
2018-11-05 23:10:57 +00:00
Mark Thompson
ec1b5216fc configure: Add missing V4L2 M2M decoder BSF dependencies
(cherry picked from commit e9d2e3fdaa)
2018-11-05 23:10:49 +00:00
Mark Thompson
066ff02621 configure: Add missing IVF muxer BSF dependency
(cherry picked from commit a4fb2b1150)
2018-11-05 23:10:41 +00:00
James Almer
398a70309e avcodec/cbs_av1: fix decoder/encoder_buffer_delay variable types
buffer_delay_length_minus_1 is five bits long, meaning decode_buffer_delay and
encoder_buffer_delay can have values up to 32 bits long.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 89a0d33e3a)
2018-11-04 22:06:20 -03:00
Mark Thompson
acd13f1255 configure: Fix av1_metadata BSF dependency
(cherry picked from commit 34429182b9)
2018-11-04 22:06:11 -03:00
James Almer
1c98cf4ddd avformat/ivfenc: use the av1_metadata bsf to insert Temporal Delimiter OBUs if needed
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 2d2af23349)
2018-11-04 22:06:08 -03:00
Marton Balint
63c1e291ef avformat/ftp: allow nonstandard 202 reply to OPTS UTF8
Fixes ticket #7481.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 8e5a2495a8)
2018-11-04 22:55:09 +01:00
Michael Niedermayer
7ebc27e1fa avcodec/cavsdec: Propagate error codes inside decode_mb_i()
Fixes: Timeout
Fixes: 10702/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5669940938407936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1cee05656)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-11-04 20:26:49 +01:00
Michael Niedermayer
bc5777bdab avcodec/mpeg4videodec: Clear partitioned frame in decode_studio_vop_header()
partitioned_frame is also set/cleared in decode_vop_header()

Fixes: out of array read
Fixes: 9789/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5638681627983872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 074187d599)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-11-04 20:26:49 +01:00