1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-19 05:49:09 +02:00

46869 Commits

Author SHA1 Message Date
Michael Niedermayer
26a4846b28
avcodec/dovi_rpu: Use 64 bit in get_us/se_coeff()
Fixes: shift exponent 32 is too large for 32-bit type 'int'
Fixes: 63151/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5067531154751488

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 2817efbba331ac1d3a39fbee78b480008ce20a93)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-11-03 22:25:35 +01:00
Michael Niedermayer
4bd4b178bf
avcodec/jpeg2000dec: Check image offset
Fixes: left shift of negative value -538967841
Fixes: 62447/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6427134337613824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 88453250dbe952e85899d04867914ef95785530e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:15 +01:00
Michael Niedermayer
181d6e17e0
avcodec/h2645_parse: Avoid EAGAIN
EAGAIN causes an assertion failure when it is returned from the decoder

Fixes: Assertion consumed != (-(11)) failed at libavcodec/decode.c:462
Fixes: assertion_IOT_instruction_decode_c_462/poc

Found-by: Hardik Shah of Vehere (Dawn Treaders team)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5ddab49d48343385eadb3a435a5491c476b66ecc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:14 +01:00
Michael Niedermayer
566e0aa8e2
avcodec/xvididct: Make c* unsigned to avoid undefined overflows
Fixes: signed integer overflow: 1496950099 + 728014168 cannot be represented in type 'int'
Fixes: 62667/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-6511785170305024

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 f7e5537dc1ff2f45a6e4c98091f15e60c3647cfc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:13 +01:00
Michael Niedermayer
76ee7c7715
avcodec/h264_parser: saturate dts a bit
Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long'
Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6112289464123392

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 7fedbc7606614cc1a6224effa8df762b6883bdc4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:13 +01:00
Michael Niedermayer
44978c5b83
avcodec/escape124: Do not return random numbers
Fixes: out of array access
Fixes: 62164/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-6035022714634240
Fixes: 62164/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-6422176201572352

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 fe6d46490f5ea9155fe0601b6246960ae17317fc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:09 +01:00
Michael Niedermayer
95b2569427
avcodec/apedec: Fix an integer overflow in predictor_update_filter()
Fixes: signed integer overflow: -2147483506 + -801380 cannot be represented in type 'int'
Fixes: 62164/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-6578985923117056

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 515c0247a3062ca4639e457c81d2f58c504e9e8f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:08 +01:00
Michael Niedermayer
6e4690ede0
avcodec/lcldec: Make PNG filter addressing match the code afterwards
Also update check accordingly

Fixes: tickets/10237/mszh_306_306_yuv422_nocompress.avi
Fixes: tickets/10237/mszh_306_306_yuv411_nocompress.avi

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d11b8bd0c610c212d2a28767f94dc07a8ec473cf)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:08 +01:00
Michael Niedermayer
d5f1ecbe24
avcodec/xvididct: Fix integer overflow in idct_row()
Fixes: signed integer overflow: 1871429831 + 343006811 cannot be represented in type 'int'
Fixes: 61784/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AIC_fuzzer-5372151001120768

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 b12444fe72173ab52b6479708cfd12cb889ca300)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:06 +01:00
Michael Niedermayer
0224effb52
avcodec/celp_math: avoid overflow in shift
by making gain unsigned we have 1 bit more available
alternatively we can clip twice as in the g729 reference

Fixes: left shift of 23404 by 17 places cannot be represented in type 'int'
Fixes: 61728/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-6280412547383296

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 6580a7b2b27973947118482235a2eb1214d968a2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:06 +01:00
Michael Niedermayer
3c56b5c3df
avcodec/jpeg2000dec: jpeg2000 has its own lowres option
jpeg2000 overrides the global lowres variable with a lowres field called reduction_factor
ffmpeg -lowres X causes the reduction_factor to be set
ffplay -lowres X causes both lowres and the reduction_factor to be set
ossfuss sets only lowres

only the ffmpeg variant works. This patch tries to make the other 2 work.

Alternative we could just error out if things are inconsistent.
More complex restructuring should be limited to the master branch
to keep this reasonably easy to backport

Fixes: out of array access
Fixes: 59672/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000

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 c012d1f2bb8735f2b17ce88cd8181d2ffc989b02)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:04 +01:00
Michael Niedermayer
55a00e464c
avcodec/huffyuvdec: avoid undefined behavior with get_vlc2() failure
Fixes: left shift of negative value -1
Fixes: 59889/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HUFFYUV_fuzzer-5472742275940352

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 90647a9249aee8c0ef6c0bced3558ada9643f5b6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:04 +01:00
Michael Niedermayer
82f7adf45d
avcodec/cscd: Fix "CamStudio Lossless Codec 1.0" gzip files
Fixes: tickets/10241/cscd_1_0_306_306_gzip.avi

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ab7d38f970674e6765b5e1adb911c1763b9ce806)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:04 +01:00
Michael Niedermayer
fccc3130c7
avcodec/cscd: Check for CamStudio Lossless Codec 1.0 behavior in end check of LZO files
Alternatively the check could be simply made more tolerant
Fixes: Ticket10227

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d2a0464fc2dd6f79571a66e6c7a8168323168e46)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:03 +01:00
Michael Niedermayer
10dfb498ea
avcodec/mpeg4videodec: consider lowres in dest_pcm[]
Fixes: out of array access
Fixes: 59999/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5767982157266944

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 d48476183fad230c8e457b2f314f8e136b973c4e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:03 +01:00
Michael Niedermayer
54d87e4b28
avcodec/hevcdec: Fix undefined memcpy()
There is likely a better way to fix this, this is mainly to show the problem

Fixes: MC within same frame resulting in overlapping memcpy()
Fixes: 60189/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4992746590175232
Fixes: 61753/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5022150806077440
Fixes: 58062/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4717458841010176

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 94bd1796ff45b396021cd260e9b037bc61815933)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:03 +01:00
Michael Niedermayer
06ff2bfe0f
avcodec/mpeg4videodec: more unsigned in amv computation
Fixes: signed integer overflow: -2147483648 + -1048576 cannot be represented in type 'int'
Fixes: 59365/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-642654923954585

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 0adaa90d89114dc86dbc5704ce31ded5b6750d13)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:02 +01:00
Michael Niedermayer
b91b26813c
avcodec/tta: fix signed overflow in decorrelate
Fixes: signed integer overflow: 2079654542 - -139267653 cannot be represented in type 'int'
Fixes: 60811/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5915858409750528

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 283bf5c35bc5ac92e061f27c3a680318175a1600)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:02 +01:00
Michael Niedermayer
e61e0ea8c6
avcodec/apedec: Fix 48khz 24bit below insane level
Fixes: Ticket9816
Fixes: vlc.ape and APE_48K_24bit_2CH_02_01.ape

Regression since: ed0001482a74b60f3d5bc5cd7e304c9d65b2fcd5.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 80ad0e2198df4e2961928d8304da58df6db77ec4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:02 +01:00
Michael Niedermayer
d548c94bfa
avcodec/apedec: Fix CRC for 24bps and bigendian
Fixes CRC for vlc.ape and APE_48K_24bit_2CH_02_01.ape

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 696e161919f18f13be0f82f41715b445d31022d7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:01 +01:00
Michael Niedermayer
7c646d22cf
avcodec/xvididct: Fix integer overflow in idct_row()
Fixes: signed integer overflow: -1403461578 + -843974775 cannot be represented in type 'int'
Fixes: 60868/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1VIDEO_fuzzer-4599793035378688

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 0ce322a51eae87fd3a0eb96f2280175554ef30c5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:01 +01:00
Michael Niedermayer
1759fd0d82
avcodec/pcm: allow Changing parameters
SDR needs this for switching between mono and stereo stations

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 94d44dbe212b3ecb67256c4edfc3d7c3c3ac4472)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:39:00 +01:00
Michael Niedermayer
fc94130cd6
avcodec/jpeg2000dec: Check for reduction factor and image offset
This combination is not working (it writes out of array)

Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9b6d191a66a8d9b3064efecc79a9f44fb14d7875)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:59 +01:00
Michael Niedermayer
515c7b21f4
avcodec/utils: fix 2 integer overflows in get_audio_frame_duration()
Fixes: signed integer overflow: 256 * 668003712 cannot be represented in type 'int'
Fixes: 59819/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-4674636538052608

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 a4bf559683a999c8faa408fdd8f29bd28a6a47ea)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:58 +01:00
Michael Niedermayer
9b10b9b8cb
avcodec/hevcdec: Avoid null pointer dereferences in MC
Fixes: runtime error: pointer index expression with base 0x000000000000 overflowed to 0xfffffffffffffff8
Fixes: 58440/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5956015530311680

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 a0f4d4e65093a4cb627f05d09b19c922e88cfac1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:58 +01:00
Michael Niedermayer
df4170b2bc
avcodec/takdsp: Fix integer overflows
Fixes: avcodec/takdsp.c:44:23: runtime error: signed integer overflow: -2097158 - 2147012608 cannot be represented in type 'int'
Fixes: 58417/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5268919664640000

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 ff8a496d41422b694f66684ada97dcf49e167782)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:57 +01:00
Michael Niedermayer
74d3c9261a
avcodec: Ignoring errors is only possible before the input end
Fixes: out of array read
Fixes: Ticket 10308

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fead656a7bf523d448fe8bd39c1f2ea36be98fb9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:57 +01:00
Michael Niedermayer
2cb93e863f
avcodec/noise_bsf: Check for wrapped frames
Wrapped frames contain pointers so they need specific code to
noise them, the generic code would lead to segfaults

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0889ebc577749ee6abc620bc9030d2002487935f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:56 +01:00
Michael Niedermayer
7337f2e8e3
avcodec/tiff: add a zero DNG_LINEARIZATION_TABLE check
Fixes: index 4294967295 out of bounds for type 'uint16_t [65536]'
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5950405086674944
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6666195176914944

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 6e98cf0280cd693ef82c4444fe15bc7aef8771b3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:55 +01:00
Michael Niedermayer
f174aa7134
avcodec/tak: Check remaining bits in ff_tak_decode_frame_header()
Fixes: out of array access
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-6682195323650048

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 19b66b89da4b4ff086dc1fc79bbf540e82bdbcb4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:54 +01:00
Michael Niedermayer
2878299b73
avcodec/sonic: Fix two undefined integer overflows
Fixes: signed integer overflow: 2147483372 - -148624 cannot be represented in type 'int'
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5477177805373440
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-6681622236233728

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 2632e9049391d820bde64d1fc138567a66464fcd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:54 +01:00
Michael Niedermayer
0c2b08227e
avcodec/utils: the IFF_ILBM implementation assumes that there are a multiple of 16 allocated
Fixes: out of array access
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5124452659888128
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-6362836707442688

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 34056a94eab5f8fbc7e0b8510f7c9851931f23b7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:54 +01:00
Michael Niedermayer
b9c79be726
avcodec/exr: Cleanup befor return
Fixes: leaks
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6703454090559488

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 885ff3b8798791eb2b0f53360a2ab4b1f9c5f6dc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:53 +01:00
Michael Niedermayer
13644a75d8
avcodec/pngdec: Do not pass AVFrame into global header decode
The global header should not contain a frame, and decoding it
would result in leaks

Fixes: memleak
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-6603443149340672

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 d31d4f32283f765c79d6e127d31ee2c37a0acef7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:53 +01:00
Michael Niedermayer
ac015347a8
avcodec/pngdec: remove AVFrame argument from decode_iccp_chunk()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7117b380a7eb9419625aa8835edec2c3c17e638b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:53 +01:00
Michael Niedermayer
efcb821157
avcodec/vorbisdec: Check codebook float values to be finite
Fixes: Timeout
Fixes: 55116/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VORBIS_fuzzer-4572159970508800

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cadd7e7a7589b5c118ad1648a09c629a6b65a3be)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:52 +01:00
Michael Niedermayer
c2b46db3f4
avcodec/g2meet: Replace fake allocation avoidance for framebuf
framebuf is only allocated when the new width/height are larger than the old
but nothing sets the old so its always allocated.
Use av_fast_mallocz() instead.

Fixes: Timeout
Fixes: 55094/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5116909932904448

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 38adbc6eebd7f2f34ecf1b0b18019e88bad9d9f4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:52 +01:00
Michael Niedermayer
1480cc1d9c
avcodec/lcldec: More space for rgb24
Fixes: Ticket 10239
Fixes: zlib_306_306_rgb24.av

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e2c3aa8e2b800c5b860315277b3ea426b8b23393)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:51 +01:00
Michael Niedermayer
002471255d
avcodec/lcldec: Support 4:1:1 and 4:2:2 with odd width
Fixes: Ticket10240
Fixes: zlib_306_306_yuv422.avi
Fixes: zlib_306_306_yuv411.avi

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0cf1ac905d2d97355a389c3baa4e132824b29f21)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:51 +01:00
Michael Niedermayer
8abcd8b124
libavcodec/lcldec: width and height should not be unsigned
Computations like col < width - 3 will not work with unsigned width=1

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3eb4e28c26c3bce608214f392ab1fe6ee28ec1df)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:51 +01:00
Michael Niedermayer
d1553cad73
avcodec/escape124: Check that blocks are allocated before use
Fixes: NULL pointer dereference
Fixes: 57819/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-5077280228769792

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 5366ae12b9ba60404822f6b39b41f6c0d98a7c8a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:50 +01:00
Michael Niedermayer
7158ad82da
avcodec/huffyuvdec: Fix undefined behavior with shift
Fixes: left shift of negative value -1
Fixes: 57554/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFVHUFF_fuzzer-4853603839115264

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 27e7857bd1127974ffe1512293abee83b1035194)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:50 +01:00
Michael Niedermayer
7c5d1725aa
avcodec/j2kenc: Replace RGB24 special case by generic test
This fixes RGB48 with libavcodec as decoder

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ad4d647591dbd953a5cf3a32a779ee5e42465bbb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:49 +01:00
Michael Niedermayer
4c07c4d29a
avcodec/j2kenc: Replace BGR48 / GRAY16 test by test for number of bits
BGR48 is not supported and this was probably meant to be RGB48 so this fixes
RGB48 a bit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7fb70d27a26bb4072edf68857636fa4343ee24a3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:49 +01:00
Michael Niedermayer
cf6ae79a71
avcodec/j2kenc: simplify pixel format setup
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 644d15716d5cfb28e4ea0c0ada163f70807e9a5c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:49 +01:00
Michael Niedermayer
0ab5965b69
avcodec/j2kenc: Fix funky bpno errors on decoding
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 816676085e3d32f27d4001d9b95590046c487eb6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:48 +01:00
Michael Niedermayer
1990527edb
avcodec/j2kenc: remove misleading pred value
This field is only checked for being 0 or not and not zero means 5/3

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0adb375377f369b69b24d86bbfe674b7693ccf3c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:48 +01:00
Michael Niedermayer
f38e5efbf2
avcodec/j2kenc: fix 5/3 DWT identifer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f6955b6df4b599ff5604e82987b96957414f8dd5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:48 +01:00
Michael Niedermayer
f34fe6b4a4
avcodec/vp3: Check width to avoid assertion failure
Fixes: Assertion failure on x86-32
       av_assert2(block_w * sizeof(pixel) <= FFABS(buf_linesize)); in ff_emulated_edge_mc()
Fixes: 39641/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-5925660741206016

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 dab1cd2dc0471d497f481736059b2023c5b7986a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:47 +01:00
Michael Niedermayer
538f355b9a
avcodec/g729postfilter: Limit shift in long term filter
Fixes: shift exponent 34 is too large for 32-bit type 'int'
Fixes: 57389/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-6229522659016704

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 6d1d8609ac1054017ea3d11b325ed94a1205e9fd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-10-30 00:38:47 +01:00