Michael Niedermayer
d61977cbe4
Changelog: update
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-14 21:48:15 +02:00
James Almer
869683430d
fate: update reference files after the recent dash manifest muxer changes
...
Missed in 487b49d8f2 .
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit aa0829d834 )
2022-04-08 16:11:00 -03:00
James Almer
472af5873f
avformat/webmdashenc: fix on-demand profile string
...
Fixes ticket #9596
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit 487b49d8f2 )
2022-04-08 00:05:40 -03:00
Michael Niedermayer
dcb2ad9125
Update for FFmpeg 4.4.2
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:29:51 +02:00
Michael Niedermayer
15006f48cd
avcodec/exr: Avoid signed overflow in displayWindow
...
The inputs are unused except for this computation so wraparound
does not give an attacker any extra values as they are already fully
controlled
Fixes: signed integer overflow: 0 - -2147483648 cannot be represented in type 'int'
Fixes: 45820/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5766159019933696
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 1291568c98 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
977cfb7197
avcodec/diracdec: avoid signed integer overflow in global mv
...
Fixes: signed integer overflow: -128275513086 * -76056576 cannot be represented in type 'long'
Fixes: 45818/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5129799149944832
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 7f1279684e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
30194a348e
avcodec/takdsp: Fix integer overflow in decorrelate_sf()
...
Fixes: signed integer overflow: -101 * 71041254 cannot be represented in type 'int'
Fixes: 45938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-4687974320701440
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 01d8c887f6 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
27a609a8b9
avcodec/apedec: fix a integer overflow in long_filter_high_3800()
...
Fixes: signed integer overflow: -2146549696 - 3923884 cannot be represented in type 'int'
Fixes: 45907/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5992380584558592
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 b085b400be )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Oneric
7ccd77a8ff
avfilter/vf_subtitles: pass storage size to libass
...
Due to a quirk of the ASS format some tags depend on the exact storage
resolution of the video, so tell libass via ass_set_storage_size.
2022-04-06 20:27:35 +02:00
Michael Niedermayer
b90c01a501
avformat/aqtitledec: Skip unrepresentable durations
...
Fixes: signed integer overflow: -5 - 9223372036854775807 cannot be represented in type 'long'
Fixes: 45665/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-475618463934054
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 c2d1597a8a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
fde82db169
avformat/cafdec: Do not store empty keys in read_info_chunk()
...
Fixes: Timeout
Fixes: 45543/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5684953164152832
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 7ec28e1d4c )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
45a021aba1
avformat/mxfdec: Do not clear array in mxf_read_strong_ref_array() before writing
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 7aebdb8bf1 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
2ad47d59af
avformat/mxfdec: Check for avio_read() failure in mxf_read_strong_ref_array()
...
Fixes: 42827/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4900528511909888
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 8d6f49cfc3 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
2a549b2e7d
avformat/mxfdec: Check count in mxf_read_strong_ref_array()
...
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 3015c556f3 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
79ad18ddbd
avformat/hls: Check target_duration
...
Fixes: signed integer overflow: 77777777777777 * 1000000 cannot be represented in type 'long long'
Fixes: 45545/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-6438101247983616
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Steven Liu <lingjiujianke@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit a8fd3f7fab )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
b27833f066
avcodec/pixlet: Avoid signed integer overflow in scaling in filterfn()
...
Fixes: signed integer overflow: 11494 * 1073741824000000 cannot be represented in type 'long'
Fixes: 26586/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PIXLET_fuzzer-5752633970917376
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 0c1f20c6c8 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
78eed60822
avformat/matroskadec: Check pre_ns
...
Fixes: division by 0
Fixes: 44615/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6681108677263360
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 710e51677a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
cd310f0502
avcodec/sonic: Use unsigned for predictor_k to avoid undefined behavior
...
Fixes: signed integer overflow: -1094995529 * 24 cannot be represented in type 'int'
Fixes: 44436/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-4874459459223552
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 28008bf95e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
cc53ce7e5b
avcodec/libuavs3d: Check ff_set_dimensions() for failure
...
Untested, no testcase
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit e88b99afdf )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
1064cf413a
avcodec/mjpegbdec: Set buf_size
...
Fixes: Timeout
Fixes: 45170/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-5874820431085568
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
326dafe40a
avformat/matroskadec: Use rounded down duration in get_cue_desc() check
...
Floating point is evil, it would be better if duration was not a double
Fixes: Infinite loop
Fixes: 45123/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6725052291219456
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 bd3a03db9a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
310a060e77
avcodec/argo: Check packet size
...
Fixes: Timeout
Fixes: 45052/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-6033489206575104
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 1bed27acef )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
e9e2ddbc6c
avcodec/g729_parser: Check channels
...
Fixes: signed integer overflow: 10 * 808464428 cannot be represented in type 'int'
Fixes: assertion failure
Fixes: ticket9651
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 757da974b2 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
061f8b941e
avformat/avidec: Check height
...
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: Ticket8486
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit ec8ff659f5 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
261557160f
avformat/rmdec: Better duplicate tags check
...
Fixes: memleaks
Fixes: 44810/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-5619494647627776
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 15a646e501 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
338444c016
avformat/mov: Disallow empty sidx
...
It appears this is not allowed "Each Segment Index box documents how a (sub)segment is divided into one or more subsegments
(which may themselves be further subdivided using Segment Index boxes)."
Fixes: Null pointer dereference
Fixes: Ticket9517
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 4419433d77 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
811047f7c2
avformat/argo_asf: Fix order of operations in error check in argo_asf_write_trailer()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit c8c12fb5d6 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
5cdceec2f2
avformat/matroskadec: Check duration
...
Fixes: -nan is outside the range of representable values of type 'long'
Fixes: 44614/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6216204841254912
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 36680078ca )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
166ee5fa68
avformat/mov: Corner case encryption error cleanup in mov_read_senc()
...
Fixes: memleak
Fixes: 42341/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4566632823914496
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 8ee0e4abcb )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
badf284b52
avcodec/jpeglsdec: Fix if( code style
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit f306b8e80a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
1caf4f91fb
avcodec/jpeglsdec: Check get_ur_golomb_jpegls() for error
...
Fixes: Timeout
Fixes: Invalid shift
Fixes: 44548/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-556487680891289
Fixes: 44569/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AMV_fuzzer-6302543246917632
Fixes: 44570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-4550196556595200
Fixes: 44592/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5651610385121280
Fixes: 44571/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5094698987945984
Fixes: 44607/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5341352013987840
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 151f83584e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
1d8caf2e1f
avcodec/motion_est: fix indention of ff_get_best_fcode()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit ce43e1c581 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
f73e9b73ce
avcodec/motion_est: Fix xy indexing on range violation in ff_get_best_fcode()
...
This codepath seems untested, no testcases change
Found-by: <mkver>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 634312a70f )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
faf66d99c0
avformat/hls: Use unsigned for iv computation
...
Fixes: signed integer overflow: 9223372036854775748 + 60 cannot be represented in type 'long'
Fixes: 44417/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-5802443881971712
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Steven Liu <lingjiujianke@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit bf33a38499 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
b356dcb2fe
avcodec/jpeglsdec: Increase range for N in ls_get_code_runterm() by using unsigned
...
Fixes: left shift of 32768 by 16 places cannot be represented in type 'int'
Fixes: Timeout
Fixes: 44219/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-4679455379947520
Fixes: 44088/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-4885976600674304
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 6ee283d7d0 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
cc4707601d
avformat/matroskadec: Check desc_bytes
...
Fixes: Division by 0
Fixes: 44035/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4826721386364928
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 5038933977 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
032672a8f1
avformat/utils: Fix invalid NULL pointer operation in ff_parse_key_value()
...
Fixes: pointer index expression with base 0x000000000000 overflowed to 0xffffffffffffffff
Fixes: 44012/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-5670607746891776
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 59328aabd2 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
d3456a374d
avformat/matroskadec: Fix infinite loop with bz decompression
...
The same check is added to zlib too, it seems not needed there though
Fixes: Infinite loop
Fixes: 43932/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-6175167573786624
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 9c3d2cbb51 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
673f8d3641
avformat/mov: Check size before subtraction
...
Fixes: signed integer overflow: -9223372036854775808 - 8 cannot be represented in type 'long'
Fixes: 43542/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5237670148702208
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 d8d9d506a3 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
447b9a0f03
avcodec/cfhd: Avoid signed integer overflow in coeff
...
Fixes: signed integer overflow: 15244032 * 256 cannot be represented in type 'int'
Fixes: 43504/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-4865014842916864
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 cd6ac013a0 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
65d8418e11
avcodec/apedec: Fix integer overflows in predictor_update_3930()
...
Fixes: signed integer overflow: 1074134419 - -1075212485 cannot be represented in type 'int'
Fixes: 43273/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-4706880883130368
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 0c9c9bbd01 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
6c5e26821e
avcodec/apedec: fix integer overflow in 8bit samples
...
Fixes: signed integer overflow: 2147483542 + 128 cannot be represented in type 'int'
Fixes: 42812/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6344057861832704
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 7cee3b3718 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
be0109b881
avformat/flvdec: timestamps cannot use the full int64 range
...
We do not support this as we multiply by 1000
Fixes: signed integer overflow: -45318575073853696 * 1000 cannot be represented in type 'long'
Fixes: 42804/clusterfuzz-testcase-minimized-ffmpeg_dem_LIVE_FLV_fuzzer-4630325425209344
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 c217ca7718 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
3fe61f91b3
avcodec/tiff: Remove messing with jpeg context
...
The whole concept is just not correct, also as it seems not to be needed
at all, all dng files i have decode without this.
Fixes: various crashes
Fixes: 42937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4625073334517760
Fixes: 42938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4643368217477120
Fixes: 42939/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4925325908246528
Fixes: 42940/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4925378806808576
Fixes: 42941/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6202009265504256
Fixes: 42944/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6076860998483968
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 afdbc940c6 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
14249d8a03
avcodec/tiff: Use ff_set_dimensions() for setting up mjpeg context dimensions
...
sets coded_width / coded_height too to keep them consistent with
width / height
Fixes: OOM
Fixes: 42263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5653333619113984
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 cfa1f0e214 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
24da8685f0
avcodec/tiff: Pass max_pixels to mjpeg context
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit d6c16f42cc )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
e2ae9adbe1
avcodec/vqavideo: reset accounting on error
...
Fixes: Timeout (same growing chunk is decoded to failure repeatedly)
Fixes: 42582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-6531195591065600
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 d8ea7a67ba )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
02b0143522
avcodec/alacdsp: fix integer overflow in decorrelate_stereo()
...
Fixes: signed integer overflow: -16777216 * 131 cannot be represented in type 'int'
Fixes: 23835/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5669943160078336
Fixes: 41101/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-4636330705944576
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 68457c1e85 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
59287d3880
avformat/4xm: Check for duplicate track ids
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit dd94912479 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
8f83d2a94a
avformat/4xm: Consider max_streams on reallocating tracks array
...
Fixes: OOM
Fixes: 41595/clusterfuzz-testcase-minimized-ffmpeg_dem_FOURXM_fuzzer-6355979363549184
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 0dcd95ef8a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
223b5abcb1
avformat/mov: Check next offset in mov_read_dref()
...
Fixes: signed integer overflow: 9223372036200463215 + 1109914409 cannot be represented in type 'long'
Fixes: 41480/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6553086177443840
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 562021e2fd )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
bbea2c47c7
avformat/vivo: Favor setting fps from explicit fractions
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit bf1e93bdc9 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
88f619726c
avformat/vivo: Do not use the general expression evaluator for parsing a floating point value
...
Fixes: Timeout
Fixes: 41564/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVO_fuzzer-6309014024093696
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 7b24615565 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
f4f397ebc1
avformat/mxfdec: Check for duplicate mxf_read_index_entry_array()
...
Fixes: memleak
Fixes: 41596/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6439060204290048
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 4f44a218e5 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
4023a8af63
avcodec/apedec: Change avg to uint32_t
...
Fixes: Integer overflow
Fixes: 40973/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6739312704618496
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Suggested-by: Anton Khirnov <anton@khirnov.net >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 0ec75723a4 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
8720b1b480
avformat/mxfdec: Check component_depth in mxf_get_color_range()
...
Fixes: shift exponent 4294967163 is too large for 32-bit type 'int'
Fixes: 41449/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6183636217495552
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 a4af92d7cb )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
4846536e67
avformat/mov: Disallow duplicate smdm
...
Fixes: memleak
Fixes: 39879/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5327819907923968
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 b5ba74053c )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
a2b5ffb4ac
avformat/mov: Check for EOF in mov_read_glbl()
...
Fixes: Infinite loop
Fixes: 41351/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5433895854669824
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 59b4e7cbd8 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
a3041cf48b
avcodec/vp3: Check version in all cases when VP4 code is not built
...
Fixes: out of array read
Fixes: 40284/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-4599568176644096
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 >
(cherry picked from commit 96caa01f13 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
4ff9f77240
avformat/mov: Check channels for mov_parse_stsd_audio()
...
Fixes: signed integer overflow: -776522110086937600 * 16 cannot be represented in type 'long'
Fixes: 40563/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6644829447127040
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 3a64a4c582 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
d4ff904e30
avformat/avidec: Check read_odml_index() for failure
...
Fixes: Timeout
Fixes: 40950/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-6478873068437504
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 57adb26d05 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
a4015d432b
avformat/aiffdec: Use av_rescale() for bitrate
...
Fixes: integer overflow
Fixes: 40313/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-4814761406103552
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 905588df97 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
d0a99fdfc6
avformat/aiffdec: sanity check block_align
...
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 93f7776921 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
Michael Niedermayer
287389faec
avformat/aiffdec: Check sample_rate
...
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 1b04836dff )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2022-04-06 20:27:35 +02:00
James Almer
a4e1dd6940
avcodec/libdav1d: free the Dav1dData packet on dav1d_send_data() failure
...
We still own it on failure, and there's no point trying to feed it again.
This should address the issue reported in dav1d #383 and part of VLC #26259 .
Signed-off-by: James Almer <jamrial@gmail.com >
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com >
2022-02-01 13:05:14 -03:00
Andreas Rheinhardt
3e539d11e4
avcodec/zmbvenc: Fix memleak upon init error
...
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 141f3053ba )
2022-01-11 22:37:58 +01:00
Andreas Rheinhardt
2de8235791
avcodec/dnxhdenc: Fix segfault when using too many slice threads
...
The DNXHD encoder's context contains an array of 32 pointers to
DNXHDEncContexts used in case of slice threading; when trying
to use more than 32 threads with slice threading, the encoder's init
function errors out, but the close function takes avctx->thread_count
at face value and tries to free inexistent elements of the array,
leading to potential crashes.
Fix this by modifying the check used to decide whether the slice
contexts should be freed.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit eb583b3cb9 )
2022-01-11 22:37:58 +01:00
Andreas Rheinhardt
44f830e7f0
avcodec/wma(dec|enc): Fix memleaks upon allocation error
...
ff_wma_init() can fail without freeing everything it has allocated;
so add the FF_CODEC_CAP_INIT_CLEANUP to the codecs using it.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit fcdb012a10 )
2022-01-11 22:37:58 +01:00
Andreas Rheinhardt
c256491f96
avfilter/avfilter: Actually error out on init error
...
Currently an error from init could be overwritten by successfully
setting the enable expression.
Reviewed-by: Nicolas George <george@nsup.org >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 10ad3cd798 )
2022-01-11 22:37:58 +01:00
Andreas Rheinhardt
edaf8c9615
avcodec/opus_silk: Remove wrong size information in function declaration
...
silk_lsp2poly()'s declaration contained arrays with array sizes;
yet these array sizes exceeded the number of actually accessed array
elements (which is related to another parameter) and this leads to
-Wstringop-overflow= warnings from GCC 11, because the arrays provided
by callers are only large enough for the actually used elements.
So replace the incorrect array sizes with comments containing
the correct array sizes. Given that these sizes are not compile-time
constants, they can only be communicated via a comment.
Reported by Paul B Mahol.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 4b15474316 )
2022-01-11 22:37:58 +01:00
Andreas Rheinhardt
953ad7b362
avformat/omadec: Don't output uninitialized values
...
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 874f03fae7 )
2022-01-11 22:37:58 +01:00
Andreas Rheinhardt
9abd7d144d
avformat/jacosubenc: Fix writing extradata
...
The terminating '\0' is no longer included in the size of
the extradata output by the demuxer since commit
36e61e24e7 .
E.g. if one remuxes the JACOsub sample JACOsub_capability_tester.jss
from the FATE suite, one receives a file not recognized as JACOsub
before this patch.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 54e8dcce8e )
2022-01-11 22:37:58 +01:00
Andreas Rheinhardt
86487300ce
avformat/cafenc: Fix memleak when trailer is never written
...
Do this by using the AVStream's priv_data for the buffer holding
the packet size data.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit d94b641b4a )
2022-01-11 22:37:45 +01:00
Andreas Rheinhardt
4d8beeaa8f
avformat/cafenc: Don't segfault upon allocation error
...
If an array for the packet sizes could not be successfully reallocated
when writing a packet, the CAF muxer frees said array, but does not
reset the number of valid bytes. As a result, when the trailer is
written later, avio_write tries to read that many bytes from NULL,
which segfaults.
Fix this by not freeing the array in case of error; also, postpone
writing the packet data after having successfully (re)allocated the
array, so that even on allocation error the file can be correctly
finalized.
Also remove an unnecessary resetting of the number of size entries
used at the end.
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 19a6b51fe6 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
71eee0d4dc
avformat/cafenc: Fix potential integer overflow
...
(As long as avio_write() only accepts an int, it makes no sense
to try to support sizes that don't fit into an int.)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 42fe438482 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
8c1899a71b
avformat/movenc: Limit ism_lookahead to a sane value
...
There can only be a maximum of 255 entries in a tfrf tag, so using
more makes no sense; moreover, several size computations can overflow
in this case. Fix this by limiting it to 255.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 1cf3c59b58 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
ecd4490dd0
avutil/utils: Remove racy check from avutil_version()
...
avutil_version() currently performs several checks before
just returning the version. There is a static int that aims
to ensure that these tests are run only once. The reason is that
there used to be a slightly expensive check, but it has been removed
in 92e3a6fdac . Today running only
once is unnecessary and can be counterproductive: GCC 10 optimizes
all the actual checks away, but the checks_done variable and the code
setting it has been kept. Given that this check is inherently racy
(it uses non-atomic variables), it is best to just remove it.
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Reviewed-by: James Almer <jamrial@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit ff80090374 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
eb998e33ef
avformat/sccdec: Don't use uninitialized data, fix crash, simplify logic
...
Up until now, the scc demuxer not only read the line that it intends
to process, but also the next line, in order to be able to calculate
the duration of the current line. This approach leads to unnecessary
complexity and also to bugs: For the last line, the timing of the
next subtitle is not only logically indeterminate, but also
uninitialized and the same applies to the duration of the last packet
derived from it.* Worse yet, in case of e.g. an empty file, it is not
only the duration that is uninitialized, but the whole timing as well
as the line buffer itself.** The latter is used in av_strtok(), which
could lead to crashes. Furthermore, the current code always outputs
at least one packet, even for empty files.
This commit fixes all of this: It stops using two lines at a time;
instead only the current line is dealt with and in case there is
a packet after that, the duration of the last packet is fixed up
after having already parsed it; consequently the duration of the
last packet is left in its default state (meaning "unknown/up until
the next subtitle"). If no further line could be read, processing
is stopped; in particular, no packet is output for an empty file.
*: Due to stack reuse it seems to be zero quite often; for the same
reason Valgrind does not report any errors for a normal input file.
**: While ff_subtitles_read_line() claims to always zero-terminate
the buffer like snprintf(), it doesn't do so if it didn't read anything.
And even if it did, it would not necessarily help here: The current
code jumps over 12 bytes that it deems to have read even when it
hasn't.
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 60e12318bb )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
fd5726a226
avformat/subtitles: Honour ff_subtitles_read_line() documentation
...
It claims to always zero-terminate its buffer like snprintf(),
yet it does it not on EOF. Because of this the mcc demuxer
used uninitialized values when reading an empty input file.
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 8766361fc1 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
91b0684024
avformat/tee: Fix leak of FIFO-options dictionary
...
Happened for all slaves which didn't use the FIFO.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 3a27fcb168 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
e7201aa246
avformat/tee: Fix leak of strings
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 4df34df642 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
0229916f15
avcodec/rasc: Fix potential use of uninitialized value
...
Fixes Coverity issue #1439566 .
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit c9b44a79d1 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
b229dce2e4
avfilter/vf_w3fdif: Fix segfault on allocation error
...
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit cd1aaec760 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
952c62f658
avfilter/af_surround: Fix memleaks upon allocation error
...
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 0429d8eed8 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
7f7e601e81
avfilter/af_vibrato: Fix segfault upon allocation error
...
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit bae96fa977 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
fdf7a28b0a
avfilter/aeval: Fix leak of expressions upon reallocation error
...
Fix this by switching to av_dynarray_add_nofree() which is more
natural anyway because the entries of the array are pointers.
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 05c1f78a72 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
116dddb928
avdevice/xv: Increase array size
...
av_image_copy() expects an array of four pointers according to its
declaration; although it currently only touches pointers that
are actually in use (depending upon the pixel format) this might
change at any time (as has already happened for the linesizes
in d7bc52bf45 ).
This fixes ticket #9264 as well as a warning from GCC 11.
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 9b17273c77 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
bdb5f6e7f8
avfilter/asrc_flite: Fix use-after-frees
...
When an flite filter instance is uninitialized and the refcount
of the corresponding voice_entry reaches zero, the voice is
unregistered, yet the voice_entry's pointer to the voice is not reset.
(Whereas some other pointers are needlessly reset.)
Because of this a new flite filter instance will believe said voice
to already be registered, leading to use-after-frees.
Fix this by resetting the right pointer instead of the wrong ones.
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 18ddb25c7a )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
566d7896c1
avfilter/asrc_flite: Don't segfault when using list_voices option
...
Could also happen if initializing flite failed* or if an unknown voice
has been selected or if registering the voice failed.
*: which it currently can't, because it is a no-op.
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 304cc03798 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
66c7329c6e
Revert "avfilter/vf_idet: reduce noisyness if the filter has been auto inserted"
...
This reverts commit 723c37d3b7 .
Said commit was in preparation for auto-inserting the idet filter.
This has never happened; even if it did, the code is wrong, because
it segfaults if the filter instance doesn't have a name (having one
is not mandatory). Furthermore, it is documented for libavfilter to
not assign any semantics to the name, which this check violates.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit f626a3d0e0 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
2e850412d3
avformat/matroskadec: Don't unnecessarily reduce aspect ratio
...
Fixes ticket #9497 .
Reviewed-by: James Almer <jamrial@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 9139dc6140 )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
f82aaea3ff
avcodec/h263: Fix global-buffer-overflow with noout flag2 set
...
h263_get_motion_length() forgot to take an absolute value;
as a consequence, a negative index was used to access an array.
This leads to potential crashes, but mostly it just accesses what
is to the left of ff_mvtab (unless one uses ASAN), thereby defeating
the purpose of the AV_CODEC_FLAG2_NO_OUTPUT because the sizes of
the returned packets differ from the sizes the encoder would actually
have produced.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 9207dc3b0d )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
de82f92b84
avcodec/vaapi_encode: Fix segfault upon closing uninitialized encoder
...
Fixes ticket #9537 .
Probably a regression since 2b32068916 .
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit d1b47f3bfc )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
1227b4e926
avcodec/movtextenc: Fix infinite loop due to variable truncation
...
Regression since af043b839c .
Fixes ticket #9409 .
Reviewed-by: Philip Langdale <philipl@overt.org >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit bb89a2f64f )
2022-01-11 15:15:53 +01:00
Andreas Rheinhardt
0066e79c9e
avcodec/libopenh264dec: Increase array sizes, fix stack-buffer overread
...
av_image_copy() expects an array of four pointers and linesizes
according to its declaration; it currently only pointers that are
actually in use (depending upon the pixel format), but this might
change at any time. It has already happened for the linesizes in
d7bc52bf45 and so increasing their
array fixes a stack-buffer overread.
This fixes a -Wstringop-overflow= and -Wstringop-overread warning
from GCC 11.2.
Reviewed-by: Linjie Fu <linjie.justin.fu@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit b0b90100bf )
2022-01-11 15:15:52 +01:00
Andreas Rheinhardt
d1f7a44e89
avcodec/libkvazaar: Increase array size
...
av_image_copy() expects an array of four pointers according to its
declaration; although it currently only touches pointers that
are actually in use (depending upon the pixel format) this might
change at any time (as has already happened for the linesizes
in d7bc52bf45 ).
This fixes a -Wstringop-overflow= warning with GCC 11.2.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit b09ea67b40 )
2022-01-11 15:15:52 +01:00
Andreas Rheinhardt
ab8830e348
avformat/aadec: Don't use the same loop counter in inner and outer loop
...
Due to this bush.aa (from the FATE suite) exported garbage metadata
with key "_040930".
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 0a76f8217e )
2022-01-11 15:15:52 +01:00
Andreas Rheinhardt
703937c494
avformat/moflex: Don't use uninitialized timebase for data stream
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 38e5ca9310 )
2022-01-11 15:15:52 +01:00
Anton Khirnov
91aa03952a
lavf/udp: do not return an uninitialized value from udp_open()
...
(cherry picked from commit 3c2b674468 )
Signed-off-by: Anton Khirnov <anton@khirnov.net >
Conflicts:
libavformat/udp.c
2022-01-11 09:17:23 +01:00
Timo Rothenpieler
458c00ea0b
avcodec/nvenc: zero-initialize NV_ENC_REGISTER_RESOURCE struct
2022-01-10 15:53:35 +01:00
Andreas Rheinhardt
5a7763bdfa
configure: Add missing libshine->mpegaudioheader dependency
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit e228d7b0db )
2022-01-06 08:35:49 +01:00
Andreas Rheinhardt
8f153214e3
avcodec/Makefile: Add missing entry for ADPCM_IMA_AMV_ENCODER
...
Forgotten in 555f5c1fc5 .
Reviewed-by: Zane van Iperen <zane@zanevaniperen.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit df4cb384fb )
2022-01-06 08:35:49 +01:00
Andreas Rheinhardt
717c7f4ae9
avcodec/Makefile: Only compile nvenc.o if needed
...
This fixes compilation errors in case nvenc is enabled
(e.g. autodected) with both nvenc-based encoders disabled
because nvenc uses ff_alloc_a53_sei(), yet only the nvenc-based
encoders require atsc_a53.
(This error does not manifest itself in case of static linking
(nothing pulls in nvenc.o), but it exists with shared builds.)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org >
2022-01-05 19:39:31 +01:00
Fei Wang
2c887141b8
avcodec/av1_vaapi: improve decode quality
...
- quantizer delta and matrix level specific.
- support loop filter delta.
- support use superres.
Signed-off-by: Fei Wang <fei.w.wang@intel.com >
(cherry picked from commit 84c73102d9 )
2021-12-28 20:04:52 +01:00
Fei Wang
582fb329a4
avcodec/av1_vaapi: enable segmentation features
...
Signed-off-by: Fei Wang <fei.w.wang@intel.com >
(cherry picked from commit dc94f2eaaf )
2021-12-28 20:04:52 +01:00
Fei Wang
5962698d25
avcodec/av1_vaapi: setting 2 output surface for film grain
...
VAAPI needs 2 output surface for film grain frame. One used for
reference and the other used for applying film grain and pushing
to downstream.
Signed-off-by: Fei Wang <fei.w.wang@intel.com >
(cherry picked from commit 7871144cf8 )
2021-12-28 20:04:52 +01:00
Fei Wang
5774a0524c
avcodec/vaapi: increase av1 decode pool size
...
For film grain clip, vaapi_av1 decoder will cache additional 8
surfaces that will be used to store frames which apply film grain.
So increase the pool size by plus 8 to avoid leak of surface.
Signed-off-by: Fei Wang <fei.w.wang@intel.com >
(cherry picked from commit 53403158cc )
2021-12-28 20:04:52 +01:00
Tong Wu
03f5a57b93
avcodec/dxva2_av1: fix global motion params
...
Defined in spec 5.9.24/5.9.25. Since function void
global_motion_params(AV1DecContext *s) already updates
gm type/params, the wminvalid parameter only need to get
the value from cur_frame.gm_invalid.
Signed-off-by: Tong Wu <tong1.wu@intel.com >
(cherry picked from commit 4e7a7d75e3 )
2021-12-28 20:04:52 +01:00
Fei Wang
8b9a48b7aa
avcodec/av1_vaapi: add gm params valid check
...
Signed-off-by: Fei Wang <fei.w.wang@intel.com >
(cherry picked from commit 0d0ea70e7b )
2021-12-28 20:04:52 +01:00
Fei Wang
481d3930d9
avcodec/av1dec: support setup shear process
...
Defined in spec 7.11.3.6/7.11.3.7.
Signed-off-by: Fei Wang <fei.w.wang@intel.com >
(cherry picked from commit de7475b111 )
2021-12-28 20:04:52 +01:00
Fei Wang
2f45969744
avcodec/av1: extend some definitions in spec section 3
...
Signed-off-by: Fei Wang <fei.w.wang@intel.com >
(cherry picked from commit 75de7fe262 )
2021-12-28 20:04:52 +01:00
Fei Wang
8aab15a91d
cbs_av1: fix incorrect data type
...
Since order_hint_bits_minus_1 range is 0~7, cur_frame_hint can be
most 128. And similar return value for cbs_av1_get_relative_dist.
So if plus them and use int8_t for the result may lose its precision.
Signed-off-by: Fei Wang <fei.w.wang@intel.com >
(cherry picked from commit e7ff5722b1 )
2021-12-28 20:04:52 +01:00
James Almer
cc33e73618
avcodec/libdav1d: let libdav1d choose optimal max frame delay
...
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit 9a7fe439d9 )
2021-11-05 21:38:37 -03:00
James Almer
61ed1182ee
avcodec/libdav1d: pass auto threads value to libdav1d
...
libdav1d 1.0.0 will be the first version supporting Dav1dSettings.n_threads == 0.
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit d873b5fffc )
2021-11-05 21:38:37 -03:00
Michael Niedermayer
7e0d640edf
Changelog: update
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-23 23:31:29 +02:00
Michael Niedermayer
73e60e4439
avcodec/flac_parser: Consider AV_INPUT_BUFFER_PADDING_SIZE
...
Fixes: out if array read
Fixes: 40109/clusterfuzz-testcase-minimized-ffmpeg_dem_FLAC_fuzzer-4805686811295744
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Mattias Wadman <mattias.wadman@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-23 23:31:08 +02:00
Michael Niedermayer
404c9331dd
avcodec/ttadsp: Fix integer overflows in tta_filter_process_c()
...
Fixes: signed integer overflow: 822841647 + 1647055738 cannot be represented in type 'int'
Fixes: 39935/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-4592657142251520
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 f24028c798 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-21 19:21:14 +02:00
Michael Niedermayer
875fbddd7d
avutil/mathematics: Document av_rescale_rnd() behavior on non int64 results
...
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit e154353fdb )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-21 19:21:14 +02:00
Michael Niedermayer
32b68a6232
avcodec/utils: Ensure 8x8 alignment for ARGO in avcodec_align_dimensions2()
...
Fixes: out of array access
Fixes: 39736/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-4820016722214912
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 17e36fac0b )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-21 19:21:14 +02:00
Michael Niedermayer
bac4bb747a
avformat/matroskadec: Reset state also on failure in matroska_reset_status()
...
The calling code does not handle failures and will fail with assertion failures later.
Seeking can always fail even when the position was previously read.
Fixes: Assertion failure
Fixes: 35253/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-4693059982983168
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 d115eec979 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-21 19:21:14 +02:00
Michael Niedermayer
ea190a10d3
avformat/wavdec: Check smv_block_size
...
Fixes: Timeout
Fixes: 39554/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-4915221701984256
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 849138f476 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-21 19:21:14 +02:00
Michael Niedermayer
6de9986c78
avformat/rmdec: Check for multiple audio_stream_info
...
Fixes: memleak
Fixes: 39166/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-5153276690038784
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 8fe3566b8f )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-21 19:21:14 +02:00
Michael Niedermayer
1abb9ab266
avcodec/apedec: Use 64bit to avoid overflow
...
Fixes: runtime error: signed integer overflow: 727298502 * 3 cannot be represented in type 'int'
Fixes: 39172/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-638602483033702
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 f059b56195 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-21 19:21:14 +02:00
Michael Niedermayer
bda2d49896
avcodec/apedec: Fix undefined integer overflow in long_filter_ehigh_3830()
...
Fixes: signed integer overflow: -2145648640 - 3357696 cannot be represented in type 'int'
Fixes: 38899/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5358815017566208
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 ad517ee6e4 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-21 19:21:14 +02:00
Michael Niedermayer
cb92d65a5b
oavformat/avidec: Check offset in odml
...
Fixes: signed integer overflow: 9223372036854775807 + 8 cannot be represented in type 'long'
Fixes: 38787/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-4859845799444480
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 255a7b423e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-21 19:21:14 +02:00
Michael Niedermayer
4ae804b6fb
avformat/mpegts: use actually read packet size in mpegts_resync special case
...
Fixes: infinite loop
Fixes: 37986/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGTSRAW_fuzzer-5292311517462528 -
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Marton Balint <cus@passwd.hu >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 83b2e4c8f1 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-21 19:21:14 +02:00
Andreas Rheinhardt
4b583e5425
fftools/ffmpeg: Fix crash when flushing non-fully setup output stream
...
The output stream's packet may not have been allocated
at that point. This happens when quitting in the following command line:
$ ./ffmpeg -lavfi abuffer=sample_fmt=u8:sample_rate=48000:channel_layout=stereo -f null -
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit fb215798c7 )
2021-10-08 11:31:37 -03:00
Timo Rothenpieler
c989427c16
avfilter/scale_npp: fix non-aligned output frame dimensions
2021-10-07 18:18:04 +02:00
Steven Liu
9738990542
Revert "avformat/hlsenc: compute video_keyframe_size after write keyframe"
...
This reverts commit b5ca8f2c66 .
This commit will make new problem about tickets: 9193,9205
It flush data into file with init file context together,
and it can get keyframe size, maybe need more method to get keyframe
size.
Signed-off-by: Steven Liu <liuqi05@kuaishou.com >
(cherry picked from commit 59032494e8 )
2021-10-07 22:08:08 +08:00
Michael Niedermayer
a2bb836e55
Changelog: update
2021-10-05 23:22:23 +02:00
Michael Niedermayer
667d62c603
swscale/alphablend: Fix slice handling
...
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 06d6726588 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:40 +02:00
Michael Niedermayer
6825af5c07
avcodec/apedec: Fix integer overflow in filter_fast_3320()
...
Fixes: signed integer overflow: 2145649668 + 3956526 cannot be represented in type 'int'
Fixes: 38351/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-4647077926273024
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 0e45886e6e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:40 +02:00
Michael Niedermayer
71d776740c
avformat/mov: Fix last mfra check
...
Fixes: signed integer overflow: 9223372036854775360 + 536870912 cannot be represented in type 'long'
Fixes: 37940/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6095637855207424
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 451ceb5131 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:40 +02:00
Michael Niedermayer
58fdd476f9
avcodec/mxpegdec: Check for AVDISCARD_ALL
...
Fixes: Fixes NULL pointer dereference
Fixes: 36610/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-6052641783283712
Fixes: 37907/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-4725170850365440
Fixes: 37904/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-6367889262247936
Fixes: 38085/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-5175270823297024
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 20afd3a63a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:40 +02:00
Michael Niedermayer
97f3abe294
avcodec/flicvideo: Check remaining bytes in FLI*COPY
...
Fixes: Timeout
Fixes: 37795/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLIC_fuzzer-4846536543043584
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 5f835efbca )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
7d313a14a1
avcodec/utils: ARGO writes 4x4 blocks without regard to the image dimensions
...
Fixes: out of array access
Fixes: 37197/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-5877046382297088
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 018b611b4b )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
b90ce02f81
avcodec/cbs_h265_syntax_template: Limit sps_num_palette_predictor_initializer_minus1 to 127
...
Fixes: index 128 out of bounds for type 'uint16_t [128]'
Fixes: 38651/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-6296416058736640
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 >
(cherry picked from commit 85413a5ae6 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
a0e38aceba
avcodec/snowdec: Maintain avmv buffer
...
This avoids reallocating per frame
Fixes: Assertion failure
Fixes: 36359/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6733238591684608
Fixes: 38623/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6098656512573440
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 0faf04e807 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
02fd9353f2
avcodec/mpeg12dec: Do not put mpeg_f_code into an invalid state on error return
...
Fixes: invalid shift
Fixes: 37018/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-5290280902328320
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 5a95abcce4 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
c524a8b4be
avcodec/mpegvideo_enc: Limit bitrate tolerance to the representable
...
Fixes: error: 1.66789e+11 is outside the range of representable values of type 'int'
Fixes: Ticket8201
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 245017ec8a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
bea287bdad
avcodec/apedec: Fix integer overflow in intermediate
...
Fixes: signed integer overflow: 559334865 * 4 cannot be represented in type 'int'
Fixes: 37929/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6751932295806976
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 90da43557f )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
2a7b3e62e0
avformat/mvdec: Do not set invalid sample rate
...
Fixes: signed integer overflow: -682581959642593728 * 16 cannot be represented in type 'long'
Fixes: 37883/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5311691517198336
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 >
(cherry picked from commit 737e6bf216 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
1d2a398827
avformat/sbgdec: Check for t0 overflow in expand_tseq()
...
Fixes: signed integer overflow: 4611686025627387904 + 4611686025627387904 cannot be represented in type 'long'
Fixes: 35489/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-4862678601433088
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Nicolas George <george@nsup.org >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit f624c92d4c )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
598d3614fd
avformat/rmdec: Use 64bit for intermediate for DEINT_ID_INT4
...
Fixes: runtime error: signed integer overflow: 65312 * 65535 cannot be represented in type 'int'
Fixes: 32832/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-4817710040088576
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 e2c2872393 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
09e0a12202
avformat/sbgdec: Check opt_duration and start for overflow
...
Fixes: signed integer overflow: 2788626175500000000 + 7118941284000000000 cannot be represented in type 'long'
Fixes: 35215/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6123272247836672
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 2768928624 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
be267aa08b
avcodec/exr: Fix undefined integer multiplication
...
Fixes: signed integer overflow: 7020950083487072256 * 2 cannot be represented in type 'long long'
Fixes: 37523/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5133634955771904
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 e67deaf86c )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
65d6de52f1
avformat/mov: Check for duplicate clli
...
Fixes: memleak
Fixes: 35261/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4869656287510528
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 9a222f140e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
e075bc192d
avformat/utils: Ignore negative duration in codec_info_duration computation
...
Fixes: signed integer overflow: -5994697211974418462 + -3255307777713450286 cannot be represented in type 'long'
Fixes: 35332/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-5868035117285376
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 4d81550df9 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
d482bf35eb
avformat/jacosubdec: Check for min in t overflow in get_shift()
...
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 34651/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5157941012463616
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 989febfbd0 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Michael Niedermayer
26083824d7
avformat/mxfdec: check channel number in mxf_get_d10_aes3_packet()
...
Fixes: Out of array access
Fixes: 37030/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5387719147651072
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 3dd5a8a135 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-10-05 23:19:39 +02:00
Stéphane Cerveau
79c114e1b2
avcodec/wmadec: handle run_level_decode error
...
Consider data as invalid if ff_wma_run_level_decode
gets out with an error.
It avoids an unpleasant sound distorsion.
See http://trac.ffmpeg.org/ticket/9358
(cherry picked from commit f9fbe2f9a9 )
2021-09-21 23:20:37 -03:00
Olivier Crête
6f24f503ef
avcodec/wma: Return specific error code
...
This way, the calling function can just forward it instead of
making it up.
Signed-off-by: Olivier Crête <olivier.crete@collabora.com >
(cherry picked from commit 521388edb7 )
2021-09-21 23:20:29 -03:00
Tong Wu
df288deb9b
avcodec/dxva2_av1: fix superres_denom parameter
...
Defined in spec 5.9.8. When superres is enabled, SuperresDenom equals
"coded_denom + SUPERRES_DENOM_MIN" instead of coded_denom.
Signed-off-by: Tong Wu <tong1.wu@intel.com >
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com >
(cherry picked from commit f31033c6ca )
2021-09-14 23:51:42 +02:00
James Almer
5e61fce832
avcodec/libdav1d: fix compilation after recent libdav1d API changes
...
They were done in preparation for an upcoming 1.0 release.
Keep supporting previous releases for the time being.
Reviewed-by: BBB
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit e204846ec1 )
2021-09-09 09:31:53 -03:00
Michael Niedermayer
b5cdf08cae
Changelog: update
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 23:14:28 +02:00
James Almer
07dec5b0c3
avcodec/utils: don't return negative values in av_get_audio_frame_duration()
...
In some extrme cases, like with adpcm_ms samples with an extremely high channel
count, get_audio_frame_duration() may return a negative frame duration value.
Don't propagate it, and instead return 0, signaling that a duration could not
be determined.
Fixes ticket #9312
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit e01d306c64 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 23:12:50 +02:00
Michael Niedermayer
620fa723b8
Update for 4.4.1
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 22:45:01 +02:00
Michael Niedermayer
b3e21be8e1
avcodec/jpeg2000dec: Check that atom header is within bytsetream
...
Fixes: Infinite loop
Fixes: 36666/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5912760671141888
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 3c659f8618 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
7d58def70a
avcodec/apedec: Fix 2 integer overflows in filter_3800()
...
Fixes: signed integer overflow: 1683879955 - -466265224 cannot be represented in type 'int'
Fixes: 37419/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6074294407921664
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 33feb527ff )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
baefa5385e
avcodec/xpmdec: Move allocations down after more error checks
...
Fixes: Timeout
Fixes: 37035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XPM_fuzzer-5142718576721920
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 e58692837c )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
34aad02457
avcodec/argo: Move U, fix shift
...
Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 37249/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-5754862984888320
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 26659fe53e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
3d5f361290
avformat/mov: Check dts for overflow in mov_read_trun()
...
Fixes: signed integer overflow: 9223372034248226491 + 3275247799 cannot be represented in type 'long'
Fixes: clusterfuzz-testcase-minimized-audio_decoder_fuzzer-4538729166077952
Reported-by: Matt Wolenetz <wolenetz@google.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 4de4bc06fd )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
e64b4a75bd
avformat/avidec: Use 64bit for frame number in odml index parsing
...
Fixes: signed integer overflow: 1179337772 + 1392508928 cannot be represented in type 'int'
Fixes: 34088/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-5846945303232512
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 a4c98c507e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
fa4ac6b43a
avcodec/mjpegbdec: Skip SOS on AVDISCARD_ALL as does mjpeg
...
Fixes: NULL pointer dereference
Fixes: 36342/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-4579188072906752
Fixes: 36344/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-5049579300061184
Fixes: 36345/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-5301149845553152
Fixes: 36374/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-6056312352931840
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 104a8399ae )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
af8de920b7
avcodec/mjpegdec: Check for bits left in mjpeg_decode_scan_progressive_ac()
...
Fixes: Timeout
Fixes: 36262/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-4969052454912000
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 909faca929 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
maryam ebrahimzadeh
fb993619d1
avformat/adtsenc: return value check for init_get_bits in adts_decode_extradata
...
As the second argument for init_get_bits (buf) can be crafted, a return value check for this function call is necessary.
'buf' is part of 'AVPacket pkt'.
replace init_get_bits with init_get_bits8.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 9ffa49496d )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
671e182cc4
avcodec/webp: Check available space in loop in decode_entropy_coded_image()
...
Fixes: Timeout
Fixes: 35401/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WEBP_fuzzer-5714401821851648
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 5e00eab611 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
fa6d6cc810
avcodec/h264dec: use picture parameters in ff_print_debug_info2()
...
Fixes: out of array read
Fixes: 36341/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6737583085322240
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 65892516d5 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
82fe7775a8
avcodec/vc1dec: ff_print_debug_info() does not support WMV3 field_mode
...
Fixes: out of array read
Fixes: 36331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-5140494328922112.fuzz
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 c59b5e3d1e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
4254dbe20f
avcodec/frame_thread_encoder: Free AVCodecContext structure on error during init
...
Fixes: MemLeak
Fixes: 8281
Fixes: PoC_option158.jpg
Fixes: CVE-2020-22037
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 7bba0dd638 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
f6f682f5aa
avcodec/faxcompr: Check for end of input in cmode == 1 in decode_group3_2d_line()
...
Fixes: Infinite loop
Fixes: 35591/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4503764022198272
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 f803635c4f )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
674adf0a02
avcodec/vc1dec: Disable error concealment for *IMAGE
...
The existing error concealment makes no sense for the image formats, they
use transformed source images which is different from keyframe + MC+difference
for which the error concealment is designed.
Of course feel free to re-enable this if you have a case where it works and
improves vissual results
Fixes: Timeout
Fixes: 36234/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-6300306743885824
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 643b2d49bf )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
f25834ab07
avcodec/sbrdsp_fixed: Fix negation overflow in sbr_neg_odd_64_c()
...
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 35593/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5182217725804544
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 8f2856a1da )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
725a0446b4
avcodec/argo: Check for even dimensions
...
Fixes: reading over the end
Fixes: 36346/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-5366943107383296
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 c2f5e9ff3c )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
88264f84c9
avformat/wtvdec: Check for EOF before seeking back in parse_media_type()
...
Fixes: Infinite loop
Fixes: 36311/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-4889181296918528
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 >
(cherry picked from commit 89505d38de )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
58477f42a2
avformat/mpc8: Check first keyframe position for overflow
...
Fixes: signed integer overflow: 9223372036854775791 + 18 cannot be represented in type 'long'
Fixes: 36307/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-4917863877050368
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 2bbef69b0b )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
fbf576417a
avcodec/exr: Check ac_count
...
Fixes: signed integer overflow: -9223372036854775808 * 2 cannot be represented in type 'long long'
Fixes: 36244/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6090656186499072
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 9bc32d7c4b )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
8a3eb4498b
avformat/wavdec: Use 64bit in new_pos computation
...
Fixes: signed integer overflow: 129 * 16711680 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6742285317439488
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 9b57d2f0a9 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
3a18a6acc4
avformat/sbgdec: Check for overflow in timestamp preparation
...
Fixes: signed integer overflow: 9223372036854775807 + 86400000000 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6731040263634944
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 9dbed90840 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
a09127eacd
avformat/dsicin: Check packet size for overflow
...
Fixes: signed integer overflow: 24672 + 2147483424 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_DSICIN_fuzzer-6731325979623424
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 9d1c47ec03 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
70fa5522c7
avformat/dsfdec: Change order of operations in bitrate computation
...
Fixes: signed integer overflow: 538976288 * 67372036 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_DSF_fuzzer-6751696819716096
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 5e38eff284 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
6d86416c92
avformat/bfi: check nframes
...
Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_BFI_fuzzer-6737028768202752
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 b4e77dfca1 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
f89b52fbca
avformat/avidec: fix position overflow in avi_load_index()
...
Fixes: signed integer overflow: 9223372033098784808 + 4294967072 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-6732488912273408
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 527821a2dd )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
622b48d1fb
avformat/asfdec_f: Check sizeX against padding
...
Fixes: signed integer overflow: 2147483607 + 64 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_fuzzer-6753897878257664
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 f034c2e36a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
6666313248
avformat/aiffdec: Check for size overflow in header parsing
...
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6723467048255488
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 bae2e19777 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
3a67e33368
avcodec/aaccoder: Add minimal bias in search_for_ms()
...
Fixes: floating point division by 0
Fixes: Ticket8218
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 75a099fc73 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
da9e84fabd
avformat/mov: Fix incorrect overflow detection in mov_read_sidx()
...
Fixes: signed integer overflow: 9223372036854775807 + 1442840321 cannot be represented in type 'long'
Fixes: 33670/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6644379491106816
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 200406d930 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
890a801468
avformat/mov: Avoid undefined overflow in time_offset calculation
...
Fixes: signed integer overflow: 8511838621821575200 - -3954125146725285889 cannot be represented in type 'long'
Fixes: 33414/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6610119325515776
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 7666d588ba )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
ebc5ea216f
avfilter/af_drmeter: Check that there is data
...
Fixes: floating point division by 0
Fixes: -nan is outside the range of representable values of type 'int'
Fixes: Ticket8307
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 4f49fa6abe )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
c7ac580288
avfilter/vf_fftdnoiz: Use lrintf() in export_row8()
...
Fixes: 1.04064e+10 is outside the range of representable values of type 'int'
Fixes: Ticket 8279
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 1f21349d20 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
433d93a3b6
avfilter/vf_mestimate: Check b_count
...
Fixes: left shift of negative value -1
Fixes: Ticket8270
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 06af6e101b )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
5334967a56
avformat/mov: do not ignore errors in mov_metadata_hmmt()
...
Fixes: Timeout
Fixes: 35637/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6311060272447488
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 c52c99a18f )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
aa5b8c9590
avformat/mxfdec: Check size for shrinking
...
av_shrink_packet() takes int size, so size must fit in int
Fixes: out of array access
Fixes: 35607/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4875541323841536
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 65b862ab59 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
maryam ebr
46bbf194c4
avcodec/dnxhddec: check and propagate function return value
...
Similar to CVE-2013-0868, here return value check for 'init_vlc' is needed.
crafted DNxHD data can cause unspecified impact.
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit 7150f95756 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
b21120a924
swscale/slice: Fix wrong return on error
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 7874d40f10 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
6a5d7fd8ad
avcodec/aacdec_template: Avoid some invalid values to be set by decode_audio_specific_config_gb()
...
Fixes: NULL pointer dereference
Fixes: decode_spectrum_and_dequant.mp4
Found-by: Rafael Dutra <rafael.dutra@cispa.de >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit eaec4df63f )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
8da08ef1ff
swscale/slice: Check slice for allocation failure
...
Fixes: null pointer dereference
Fixes: alloc_slice.mp4
Found-by: Rafael Dutra <rafael.dutra@cispa.de >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 997f9cfc12 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
3b6f7601b7
avformat/matroskadec: Fix handling of huge default durations
...
Fixes: negation of -9223372036854775808 cannot be represented in type 'int64_t' (aka 'long'); cast to an unsigned type to negate this value to itself
Fixes: 33997/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6752039691485184
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 343d950a4a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
1196932f1c
avcodec/lpc: check for zero err in normalization in compute_lpc_coefs()
...
Fixes: floating point division by 0
Fixes: Ticket8213
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 70874e024a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
09f47af747
avcodec/j2kenc: Check for av_strtok() failure
...
Fixes: CID1466601 Dereference null return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 6a6a765fa4 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
35a2e71385
avformat/ftp: Check for av_strtok() failure
...
Fixes: CID1396258 Dereference null return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 9d40782088 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
9f97a023d6
tools/cws2fws: Check read() for failure
...
Fixes: CID1452579 Argument cannot be negative
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 0b3cdd7cc2 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
8f0d442434
avcodec/cpia: Fix missing src_size update
...
Fixes: out of array read
Fixes: 35210/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CPIA_fuzzer-5669199688105984
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 cea05864e6 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
7b5308045e
avcodec/exr: Better size checks
...
Fixes: signed integer overflow: 3530839700044513368 + 8386093932303352321 cannot be represented in type 'long long'
Fixes: 35182/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5398383270428672
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 18b0dd0738 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
bb1d2cf898
avcodec/clearvideo: Check tile_size to be not too large
...
Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 35023/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CLEARVIDEO_fuzzer-6740166587842560
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 11fac9613e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
417bc2a5b0
avcodec/utils: Use 64bit for intermediate in AV_CODEC_ID_ADPCM_THP* duration calculation
...
Fixes: signed integer overflow: 486539264 * 14 cannot be represented in type 'int'
Fixes: 35281/clusterfuzz-testcase-minimized-ffmpeg_dem_RSD_fuzzer-6068262742917120
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 00ae9b77ef )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
5f891809d7
avformat/aaxdec: Check avio_seek() in header reading
...
Fixes: Timeout
Fixes: 32450/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-4875522262827008
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 602bbf71f6 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
b49039b23e
avcodec/hevc_sei: Use get_bits_long() for time_offset_value
...
Fixes: assertion failure
Fixes: crash_1
Found-by: Thuan Pham <tpham.unimelb@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit d866787dac )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
ee34b6549f
avformat/rmdec: Check old_format len for overflow
...
Maybe such large values could be disallowed earlier and closer to where
they are set.
Fixes: signed integer overflow: 538976288 * 8224 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-6704350354341888
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 06d174e289 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
de255793d2
avformat/realtextdec: Check the pts difference before using it for the duration computation
...
Fixes: signed integer overflow: 5404200000 - -9223372031709351616 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_REALTEXT_fuzzer-6737340551790592
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 fe12aa6890 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
9957286378
avformat/qcp: Avoid negative nb_rates
...
Fixes: signed integer overflow: 2 * -1725947872 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_QCP_fuzzer-6726807632084992
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 1b865cc703 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
b425df191c
avformat/pp_bnk: Use 64bit in bitrate computation
...
Fixes: signed integer overflow: 1207959552 * 4 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_PP_BNK_fuzzer-6747301169201152
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 88fc295838 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
acfce11c48
avformat/nutdec: Check tmp_size
...
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6739990530883584
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 1ca00b5e44 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
704e4b8213
avformat/msf: Check that channels doesnt overflow during extradata construction
...
Fixes: signed integer overflow: 2048 * 1122336 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MSF_fuzzer-6726959600107520
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 a1a277926b )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
8bddb1d3ef
avformat/subtitles: Check pts difference before use
...
Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPL2_fuzzer-6747053545881600
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 e7a990164f )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
a04d889c52
avformat/mpc8: Check for position overflow in mpc8_handle_chunk()
...
Fixes: signed integer overflow: 15 + 9223372036854775796 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6723520756318208
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6739833034768384
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 8ef25d1182 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
612472c647
avformat/mccdec: Fix overflows in num/den
...
Fixes: signed integer overflow: 6365816 * 1000 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MCC_fuzzer-6737934184218624
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 ff05326081 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
ce60ee3e5c
avformat/iff: Use 64bit in duration computation
...
Fixes: signed integer overflow: 588 * 16719904 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6748331936186368
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 93d964689c )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
982654b90c
avformat/dxa: Check fps to be within the supported range more precissely
...
Fixes: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: assertion failure
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_DXA_fuzzer-6744985740378112
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 6ea494befc )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
b01534293e
avcodec/iff: Only write palette to plane 1 if its PAL8
...
Fixes: null pointer passed as argument 1, which is declared to never be null
Fixes: 33791/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5107575256383488.fuzz
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 216eb60b85 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Michael Niedermayer
b354bcf027
avformat/tta: Check for EOF in index reading loop
...
Fixes: OOM
Fixes: 33585/clusterfuzz-testcase-minimized-ffmpeg_dem_TTA_fuzzer-4564665830080512
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 b72d657b73 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-09-08 21:31:50 +02:00
Jan Ekström
b1f2d203c0
avfilter/vf_scale: set the RGB matrix coefficients in case of RGB
...
This fixes the passing through of non-RGB matrix from input to
output when conversion from YCbCr to RGB happens.
(cherry picked from commit 2818b14392 )
2021-09-06 09:11:25 +03:00
Jan Ekström
ae057cec10
avfilter/vf_scale: reset color matrix in case of identity & non-RGB
...
Fixes passing through mismatching metadata from the input side
when RGB input (from f.ex. H.264 or HEVC) gets converted to YCbCr.
Fixes #9132
(cherry picked from commit 9dd410c804 )
2021-08-28 20:59:22 +03:00
Jan Ekström
926d8b844f
ffmpeg: fix order between field order autodetection and override
...
Having the override before autodetection meant that the overridden
value got overwritten by the autodetected result each time,
effectively disabling the ability to utilize the `-top` option
for override purposes.
Somehow I missed this in fbb44bc51a ,
even though the lines were within the context. Probably the code
originally being after this logic had something to do with it,
but previously it only touched the avformat context's codecpar,
which did not affect the encoder codec context whatsoever.
Fixes #9320
Fixes #9339
(cherry picked from commit 4c694093be )
2021-08-28 20:58:58 +03:00
James Almer
bf87bdd3f6
avcodec/h264_slice: clear old slice POC values on parsing failure
...
If a slice header fails to parse, and the next one uses different Sequence and
Picture parameter sets, certain values may not be read if they are not coded,
resulting in the previous slice values being used.
Signed-off-by: James Almer <jamrial@gmail.com >
2021-08-10 15:22:12 -03:00
Marton Balint
de1132a891
avfilter/f_metadata: do not return the frame early if there is no metadata
...
The early return caused isses for the "add" mode (got fixed in
c95dfe5cce ) and the "select" mode needs a similar
fix. It is probably better to fully remove the check, since all modes work
correctly with NULL metadata.
Signed-off-by: Marton Balint <cus@passwd.hu >
(cherry picked from commit 758e2da289 )
2021-07-18 22:32:22 +02:00
Martin Storsjö
031c0cb0b4
ffbuild: Avoid using the --preprocessor argument to windres
...
Instead use --preprocessor-arg; in binutils 2.36, the --preprocessor
flag was changed so that it no longer accepts a string containing
multiple arguments, but the whole --preprocessor argument is
treated as the path to the preprocessor executable (where the path
can contain spaces).
It's currently unclear whether this behaviour will stay or if it
is going to be reverted in the future, see discussion at [1]. Just
to be safe, avoid using the --preprocessor argument. Don't redeclare
the full preprocessing command, but just add the $(CC_DEPFLAGS) options.
Based on a patch by Kyle Schwartz.
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=27594
Signed-off-by: Martin Storsjö <martin@martin.st >
(cherry picked from commit f9626d1065 )
2021-06-24 23:25:30 +03:00
James Almer
3f06be77ac
avcodec/crystalhd: signal that the decoder sets all output frame properties
...
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit ec8e95296e )
2021-06-23 11:24:56 -03:00
James Almer
6136f1398a
avcodec/cuviddec: signal that the decoder sets all output frame properties
...
Fixes memleaks described in ticket #9082 .
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit 6b4805686c )
2021-06-23 11:24:53 -03:00
James Almer
4a953e5c81
avcodec/decode: reindent after the previous commit
...
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit b4c2ff3e41 )
2021-06-23 11:21:09 -03:00
James Almer
28e803d637
avcodec/decode: add an internal codec flag to signal a decoder sets all output frame properties
...
Decoders like cuviddec ignore and overwrite all the properties set by the generic
code as derived from AVCodecInternal.last_pkt_props. This flag ensures libavcodec
will not store and potentially queue input packets that ultimately will not be used.
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit 7b9610ebd8 )
2021-06-23 11:17:06 -03:00
James Almer
7015704640
avcodec/decode: fetch packets from the pkt_props FIFO on every frame returned
...
Fixes memleaks on decoders that don't call ff_decode_frame_props(), like
libdav1d.
Signed-off-by: James Almer <jamrial@gmail.com >
(cherry picked from commit a4fb03563a )
2021-06-21 16:31:26 -03:00
Michael Niedermayer
91aa49218e
Update missed irc links
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit c067d20177 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
c5df87e259
avformat/rpl: The associative law doesnt hold for signed integers in C
...
Add () to avoid undefined behavior
Fixes: signed integer overflow: 9223372036854775790 + 57 cannot be represented in type 'long'
Fixes: 34983/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5765822923538432
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 480f11bdd7 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
29d3e924a6
avcodec/faxcompr: Check available bits in decode_uncompressed()
...
Fixes: Timeout
Fixes: 34950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5686764151898112
Fixes: 34966/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4587409334468608
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 ff56c139e0 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
d91f3644ce
avcodec/faxcompr: Check if bits are available before reading in cmode == 9 || cmode == 10
...
Fixes: Timeout
Fixes: 34950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5686764151898112
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 7d8421e3d5 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
4afa465eb3
avformat/utils: Avoid overflow in codec_info_duration computation for subtitles
...
Fixes: signed integer overflow: 9223126845747118112 - -2594073385365397472 cannot be represented in type 'long'
Fixes: 34936/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-6739888002170880
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 ffe4851e23 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
71b264c8fa
avformat/utils: check dts/duration to be representable before using them
...
Fixes: signed integer overflow: 6854513951393103890 + 3427256975738527712 cannot be represented in type 'long'
Fixes: 32936/clusterfuzz-testcase-minimized-ffmpeg_dem_R3D_fuzzer-5236914752978944
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 bf4e7ec825 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
a21c64199c
avcodec/utils: do "calc from frame_bytes, channels, and block_align" in 64bit
...
Fixes: signed integer overflow: 104962766 * 32 cannot be represented in type 'int'
Fixes: 33614/clusterfuzz-testcase-minimized-ffmpeg_dem_RSD_fuzzer-6252129036664832
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 3447979d08 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
93ef174211
avcodec/ttadata: Add sentinel at the end of ff_tta_shift_1
...
Fixes: out of array access
Fixes: 34933/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5629322560929792
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 dbbcfbcc4e )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
7af1a73711
avformat/mov: Check for duplicate mdcv
...
Fixes: memleak
Fixes: 34932/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5456227658235904
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 f54d85cee6 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
79b69b5f4c
avfilter/vf_dctdnoiz: Check threads
...
Fixes: floating point division by 0
Fixes: Ticket 8269
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 4a3917c02c )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
42ae283652
avfilter/vf_ciescope: Fix undefined behavior in rgb_to_xy() with black
...
Fixes: floating point division by 0
Fixes: undefined behavior in handling NaN
Fixes: Ticket 8268
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 3d500e62f6 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
f91056a25a
avcodec/dpx: fix off by 1 in bits_per_color check
...
Fixes: CID1476303 Bad bit shift operation
Fixes: 34871/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-6331163028357120
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit ca9025f374 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
57f68127da
avformat/rpl: Check for EOF and zero framesize
...
Fixes: Infinite loop
Fixes: 34751/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5439330800762880
Fixes: 34774/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5851571660390400
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 a0a4a527c3 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
350bedf7e2
avcodec/vc2enc: Check for non negative slice bounds
...
Fixes: invalid shifts
Fixes: Ticket 8221
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit f7862e8268 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
5664263561
avformat/rpl: Use 64bit in bitrate computation and check it
...
Fixes: signed integer overflow: 777777776 * 4 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-6726188921913344
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 29b244ffc1 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
78b71acab7
avcodec/mpegvideo_enc: Reset stuffing bits if they are not supported
...
Fixes: Assertion failure
Fixes: Ticket8202
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 996797f8ed )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
478c5d838b
avcodec/svq1enc: Do not print debug RD value before it has been computed
...
Avoids floating point division by 0
Fixes: Ticket8191
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit c297f7e57a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
159403fc9f
avcodec/aacpsy: Check bandwidth
...
Fixes: Ticket8011
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 36dead4bc2 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
27727d56bf
avcodec/aacenc: Do not divide by lambda_count if it is 0
...
Avoids Floating point division by 0
Fixes: Ticket8011
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit c520b98691 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
2b70d3941f
avcodec/aacenc: Use FLT_EPSILON for lambda minimum
...
(cherry picked from commit 4b89cf7aa4 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
6e2b18a895
avfilter/vf_yadif: Fix handing of tiny images
...
Fixes: out of array access
Fixes: Ticket8240
Fixes: CVE-2020-22021
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 7971f62120 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
cea03683b9
avfilter/vf_vmafmotion: Check dimensions
...
Fixes: out of array access
Fixes: Ticket8241
Fixes: Ticket8246
Fixes: CVE-2020-22019
Fixes: CVE-2020-22033
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 82ad1b7675 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
5f9f689497
avformat/movenc: Check pal_size before use
...
Fixes: assertion failure
Fixes: out of array read
Fixes: Ticket8190
Fixes: CVE-2020-22015
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 4c1afa2925 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
7fbea837fd
avcodec/lpc: Avoid floating point division by 0
...
Fixes: Ticket7996
Fixes: CVE-2020-20445
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 38d18fb578 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
5828700d5c
avcodec/aacpsy: Avoid floating point division by 0 of norm_fac
...
Fixes: Ticket7995
Fixes: CVE-2020-20446
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 223b5e8ac9 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
05cca35df9
avcodec/aacenc: Avoid 0 lambda
...
Fixes: Ticket8003
Fixes: CVE-2020-20453
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit a7a7f32c8a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
43bdf562c3
avcodec/exr: More strictly check dc_count
...
Fixes: out of array access
Fixes: exr/deneme
Found-by: Burak Çarıkçı <burakcarikci@crypttech.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 26d3c81bc5 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
fa38dfc0ef
avcodec/exr: x/ymax cannot be INT_MAX
...
The code uses x/ymax + 1 so the maximum is INT_MAX-1
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 33158/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5545462457303040
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 48342aa075 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
5d3c96cf11
avformat/avio: Check av_opt_copy() for failure
...
Fixes: CID1477416 Unchecked return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit f8611ae1ef )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
95224c3ffb
avformat/moflex: Remove unneeded format variable
...
Fixes: CID1477423 Uninitialized scalar variable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 36a3a5050a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
567eacd42e
avformat/fifo: check for flushed packets and timeshift
...
Fixes: CID1464151 Dereference after null check
Reviewed-by: Marton Balint <cus@passwd.hu >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 3e44bd068f )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
a6bd1bdd12
avcodec/clearvideo: Check for 0 tile_shift
...
Fixes: shift exponent -1 is negative
Fixes: 33401/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CLEARVIDEO_fuzzer-5908683596890112
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 63e75e09ae )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
3f81371bd4
avcodec/vc1: Check remaining bits in ff_vc1_parse_frame_header()
...
Fixes: Timeout
Fixes: 33156/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-6259655027326976
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 38c4761588 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
6f7a7b5ffb
avformat/mov: Ignore duplicate CoLL
...
Fixes: memleak
Fixes: 32146/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5377612845285376
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 9548dc74d8 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
409c33e5f8
avformat/mov: Limit nb_chapter_tracks to input size
...
Fixes: Timeout (15k loop iterations instead of 400m)
Fixes: 31368/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6601583174483968
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 299a56c900 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
ba1cc675eb
avformat/utils: Use 64bit earlier in r_frame_rate check
...
Fixes: signed integer overflow: 1406796319 * 2 cannot be represented in type 'int'
Fixes: 32777/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5632576913014784
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 578633fc1a )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
0dc1c85644
avcodec/alsdec: Fix decoding error with mono audio files
...
highest_decoded_channel is modified to serve as meant.
Reported-by: Noboru Harada <noboru@ieee.org >
Regression since: a11aa5f3ed
Fixes: Sin48k16bit1ch.mp4
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit f7987ce966 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
5f0c0883c2
avformat/mvdec: Check sample rate in parse_audio_var()
...
Fixes: signed integer overflow: -635424002382840000 * 16 cannot be represented in type 'long'
Fixes: 33612/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5704741108711424
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 >
(cherry picked from commit 0ff60249a5 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
89d8eae0c6
avcodec/faxcompr: Check for end of bitstream in decode_group3_1d_line() and decode_group3_2d_line()
...
Fixes: infinite loop
Fixes: 33674/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4816457818046464
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 08d2df4153 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
82de510a59
avcodec/utils: treat PAL8 for jpegs similar to other colorspaces
...
Fixes: out of array access
Fixes: 33713/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5778775641030656
Fixes: 33717/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEGLS_fuzzer-4960397238075392
Fixes: 33718/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-5314270096130048.fuzz
Fixes: 33719/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5352721864589312
Fixes: 33721/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5938892055379968
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 f0ce023ddb )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
1abd61e006
avcodec/jpeglsdec: Set alpha plane in PAL8 so image is not 100% transparent
...
Fixes: tickets/3933/128.jls
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 011006874c )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
2d177dba88
avformat/asfdec_o: Use ff_get_extradata()
...
Fixes: OOM
Fixes: 27240/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-5937469859823616
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 098314e1e5 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
6f83f6de04
avformat/id3v2: Check end for overflow in id3v2_parse()
...
Fixes: signed integer overflow: 9223372036840103978 + 67637280 cannot be represented in type 'long'
Fixes: 33341/clusterfuzz-testcase-minimized-ffmpeg_dem_DSF_fuzzer-6408154041679872
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 efdb564504 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
f0d9b5899a
avformat/mxfdec: Fix file position addition
...
Fixes: signed integer overflow: 9223372036854775805 + 4 cannot be represented in type 'long'
Fixes: 29927/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5579985228267520
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 f7c3484b26 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
c1d3a0638a
avformat/wtvdec: Improve size overflow checks in parse_chunks()
...
Fixes: signed integer overflow: 32 + 2147483647 cannot be represented in type 'int
Fixes: 32967/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-5132856218222592
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 >
(cherry picked from commit f8ec1da8ac )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
7f0353bc55
avcodec/faxcompr: Check remaining bits on error in decode_group3_1d_line()
...
Fixes: Timeout
Fixes: 32886/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4779761466474496
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 7b3881f0da )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
26369e6ca9
avformat/mov: check for pts overflow in mov_read_sidx()
...
Fixes: signed integer overflow: 9223372036846336888 + 4278255871 cannot be represented in type 'long'
Fixes: 32782/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6059216516284416
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 ee53bb2399 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
246b3d58a9
avcodec/utils: Check ima wav duration for overflow
...
Fixes: signed integer overflow: 44331634 * 65 cannot be represented in type 'int'
Fixes: 32120/clusterfuzz-testcase-minimized-ffmpeg_dem_RSD_fuzzer-5760221223583744
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 f40e9b1355 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
f4c5abe2d0
avcodec/rv10: Execute whole size check earlier for rv20
...
Fixes: Timeout
Fixes: 31380/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV20_fuzzer-5230899257016320
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 f8556b632f )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
3d2af8afef
avformat/cafdec: Check channels
...
Fixes: signed integer overflow: -1184429040541376544 * 32 cannot be represented in type 'long'
Fixes: 31788/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6236746338664448
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 641c1db22b )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
48be6b27e7
avcodec/exr: increase vlc depth
...
Fixes: shift exponent -4 is negative
Fixes: 32265/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-465133454137753
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 3344079d30 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
b3f458f89f
avcodec/dpx: Check bits_per_color earlier
...
Fixes: shift exponent 251 is too large for 32-bit type 'int'
Fixes: 32147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-5519111675314176
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 c093eb3031 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Michael Niedermayer
b2a94f5937
avformat/mvi: Check audio_data_size to be non negative
...
Fixes: left shift of negative value -224
Fixes: 32144/clusterfuzz-testcase-minimized-ffmpeg_dem_MVI_fuzzer-4971479323246592
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 7e241a1b73 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-06-18 20:53:56 +02:00
Timo Rothenpieler
8d172d9409
avcodec/nvenc: disable s12m timestamps by default
...
Leads to weird crashes with valid looking input data for otherwise
unknown reasons.
2021-05-29 23:29:06 +02:00
Martin Storsjö
c813f5e343
aarch64: hevc_idct: Fix overflows in idct_dc
...
This is marginally slower, but correct for all input values.
The previous implementation failed with certain input seeds, e.g.
"checkasm --test=hevc_idct 98".
Signed-off-by: Martin Storsjö <martin@martin.st >
(cherry picked from commit f27e3ccf06 )
2021-05-22 22:33:20 +03:00
Fei Wang
f7468a9c40
avcodec/vaapi_av1: pass full buffer size for each tile
...
Previously, only the size of a given tile was passed, making the
offset and size marked in VASliceParameterBufferAV1 invalid with
multiple tiles.
Signed-off-by: Fei Wang <fei.w.wang@intel.com >
(cherry picked from commit 9b131e8500 )
2021-05-20 17:12:40 +03:00
Zane van Iperen
49e3dd7709
avcodec/videotoolboxenc: #define TARGET_CPU_ARM64 to 0 if not provided by the SDK
...
Fixes build failure on older SDKs without it.
Fixes #9242
(cherry picked from commit f9eb440e78 )
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com >
2021-05-19 10:40:30 +10:00
Anton Khirnov
e87e006121
lavc/pngdec: fix updating reference frames for APNG_DISPOSE_OP_BACKGROUND
...
They should be treated the same as APNG_DISPOSE_OP_NONE.
Broken in 5663301560 .
Fixes #9184 .
(cherry picked from commit aa726eaed9 )
Signed-off-by: Anton Khirnov <anton@khirnov.net >
2021-05-14 11:17:33 +02:00
Jan Ekström
70405dd7e3
ffmpeg: return no chosen output if an uninitialized stream is unavailable
...
Otherwise the rate emulation logic in `transcode_step` never gets
hit, and the unavailability flag never gets reset, leading to an
eternal loop with some rate emulation use cases.
This change was missed during the rework of ffmpeg.c, in which
encoder initialization was moved further down the time line in
commit 67be1ce0c6 . Previously,
as the encoder initialization had happened earlier, this state was
not possible (flow getting as far as hitting the rate emulation logic,
yet not having the encoder initialized yet).
Fixes #9160
(cherry picked from commit ec20b81302 )
2021-05-13 18:12:02 +03:00
Andreas Rheinhardt
74bcfe5f85
avcodec/h263, h263data: Move ff_h263_init_rl_inter to h263.c
...
The SVQ1 decoder does not need mpegvideo or rl.c, but it uses stuff
from h263data.c. But since 61fe481586
h263data.c called ff_rl_init() and this of course led to build errors
when the SVQ1 decoder is enabled and mpegvideo disabled.
Fix this by moving ff_h263_init_rl_inter() to h263.c.
Fixes ticket #9224 .
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit e2301feabc )
2021-05-12 07:03:32 +02:00
Andreas Rheinhardt
01701019e0
configure: Add missing mpegvideo dependency for IPU decoder
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 8f588eea8e )
2021-05-12 07:02:58 +02:00
Andreas Rheinhardt
70d1af5690
avcodec/ttmlenc: Don't confuse capabilities and caps_internal
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 14a6025384 )
2021-05-10 22:20:22 +02:00
James Almer
75c3969292
avformat/mpegts: add missing sample_rate value to Opus extradata
...
Finishes fixing ticket #9190 .
Signed-off-by: James Almer <jamrial@gmail.com >
2021-05-02 20:54:59 -03:00
James Almer
40b896a781
avformat/movenc: fix writing dOps atoms
...
Don't blindly copy all bytes in extradata past ChannelMappingFamily. Instead
check if ChannelMappingFamily is not 0 and then only write the correct amount
of bytes from ChannelMappingTable, as defined in the spec[1].
Fixes part of ticket #9190 .
[1] https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2
Signed-off-by: James Almer <jamrial@gmail.com >
2021-05-02 20:54:59 -03:00
James Almer
ede71f4f57
avcodec/av1_metadata: don't store the inserted TD OBU in stack
...
Fixes: stack-use-after-return
Fixes: clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_METADATA_fuzzer-5931515701755904
Fixes: clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_METADATA_fuzzer-6105676541722624
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
Signed-off-by: James Almer <jamrial@gmail.com >
2021-05-02 20:52:34 -03:00
Andreas Rheinhardt
023bc5d926
avcodec/nellymoserenc: Fix segfault when using unsupported channels/rate
...
NellyMoserEncodeContext.avctx is only set in init after these checks,
yet it is used by encode_end().
This is a regression since 0a56bfa71f .
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 652279e35b )
2021-04-29 02:28:20 +02:00
Brad Smith
7e9b9f24df
avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD
...
Signed-off-by: Brad Smith <brad@comstyle.com >
Signed-off-by: Marton Balint <cus@passwd.hu >
(cherry picked from commit c8fb68ec52 )
2021-04-24 09:24:03 +02:00
Timo Rothenpieler
e3fb0f0c88
avcodec/nvenc: fix lossless tuning logic
...
Relying on the order of the enum is bad.
It clashes with the new presets having to sit at the end of the list, so
that they can be properly filtered out by the options parser on builds
with older SDKs.
So this refactors nvenc.c to instead rely on the internal NVENC_LOSSLESS
flag. For this, the preset mapping has to happen much earlier, so it's
moved from nvenc_setup_encoder to nvenc_setup_device and thus runs
before the device capability check.
2021-04-18 11:43:52 +02:00
Timo Rothenpieler
acb339bb88
avfilter/overlay_cuda: check av_buffer_ref result
2021-04-11 10:22:57 +02:00
Timo Rothenpieler
5873e06460
avfilter/overlay_cuda: hold explicit reference to hw_device_ctx
2021-04-11 10:22:54 +02:00
Andreas Rheinhardt
450f5ae49d
avformat/matroskaenc: Fix leak when writing attachment without filename
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
(cherry picked from commit 08c805f4ac )
2021-04-10 05:17:21 +02:00
Michael Niedermayer
f68ab9de4e
Changelog: replace <next> by 4.4
...
Found-by: <jamrial>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2021-04-09 06:26:39 +02:00