1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

114832 Commits

Author SHA1 Message Date
Leo Izen
0ab20b5788
avcodec/pngenc: fix sBIT writing for indexed-color PNGs
We currently write invalid sBIT entries for indexed PNGs, which by PNG
specification[1] must be 3-bytes long. The values also are capped at 8
for indexed-color PNGs, not the palette depth. This patch fixes both of
these issues previously fixed in the decoder, but not the encoder.

[1]: https://www.w3.org/TR/png-3/#11sBIT

Regression since: c125860892e931d9b10f88ace73c91484815c3a8.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla: <ramiro.polla@gmail.com>
2024-07-30 05:45:08 -04:00
Leo Izen
63e90b338c
avcodec/pngdec: use 8-bit sBIT cap for indexed PNGs per spec
The PNG specification[1] says that sBIT entries must be at most the bit
depth specified in IHDR, unless the PNG is indexed-color, in which case
sBIT must be between 1 and 8. We should not reject valid sBITs on PNGs
with indexed color.

[1]: https://www.w3.org/TR/png-3/#11sBIT

Regression since 84b454935fae2633a8a5dd075e22393f3e8f932f.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
Reported-by: Ramiro Polla <ramiro.polla@gmail.com>
2024-07-30 05:45:01 -04:00
James Almer
c77a3b8d29 avformat/mov: check that child boxes of trak are only present inside it
Based on the check done for the stco box.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e7d3ff8dcd8c8d02b67a0c2b192b1b4f25cc552e)
2024-07-28 20:44:58 -03:00
James Almer
d517a84c85 avformat/mov: check that sample and chunk count is 1 for HEIF
Fixes NULL pointer dereference in broken/fuzzed streams.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 2aa63784b533f461785c3e767e354e84c7e2c8c2)
2024-07-28 20:44:58 -03:00
Zhao Zhili
a83c1a3db9 avcodec/videotoolboxenc: Fix bitrate doesn't work as expected
Commit 4ef5e7d4722 add qmin/qmax support to videotoolbox encoder.
The default value of (qmin, qmax) is (2, 31), which makes bitrate
control doesn't work as users' expectations.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
(cherry picked from commit d07da7539d54c0ce71e06a577eb1fa3036467449)
2024-07-26 20:13:07 +08:00
Jens Frederich
5f953ac26f
avdevice/dshow: Don't skip audio devices if no video device is present
The search of the current DirectShow device list has been customized so
that audio devices are always found even if no video device is connected.

Signed-off-by: Jens Frederich <jens.frederich@vector.com>
Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 60b1750134963e8326476c4fbae41cea1772ff5b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:22 +02:00
Michael Niedermayer
a0d1902e2c
avcodec/hdrenc: Allocate more space
This needs to be double checked or a checking way of writing should be used

Fixes: out of array access
Fixes: 70007/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HDR_fuzzer-5478704150020096

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 204f7f8cc73109d14c3f76b7b57f6b36fe041ee8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:22 +02:00
Michael Niedermayer
adcb97538a
avcodec/cfhdenc: Height of 16 is not supported
Fixes: out of array access
Fixes: 68941/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5990952685600768

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 5dde255abdeb50aefb0dcf8b060277e37d180ec6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:21 +02:00
Michael Niedermayer
68a017f6b5
avcodec/cfhdenc: Allocate more space
Fixes: Assertion failure
Fixes: 68979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5375874714107904

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 a308d79e4dedea11667cb2ad42c6676ce96e8ee1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:21 +02:00
Michael Niedermayer
71dc382513
avcodec/osq: fix integer overflow when applying factor
Fixes: signed integer overflow: -35511773 * 256 cannot be represented in type 'int'
Fixes: 70406/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6545326804434944

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 6420c1bf30884d5feb69d0a6f116eaceac02dacc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:21 +02:00
Michael Niedermayer
354d5b9737
avcodec/osq: avoid using too large numbers for shifts and integers in update_residue_parameter()
Fixes: 2.96539e+09 is outside the range of representable values of type 'int'
Fixes: Assertion n>=0 && n<=32 failed at libavcodec/get_bits.h:423
Fixes: 62241/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-4525761925873664
Fixes: 70406/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6545326804434944

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 56c334d732dbbce43b0c8fc0809ec545b7946832)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:20 +02:00
Michael Niedermayer
5faff14b90
avcodec/vaapi_encode: Check hwctx
Fixes: null pointer dereference
Fixes: 70376/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_VAAPI_fuzzer-4733551250046976

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 3cd077e2820679e8b9f8eb10954b4f5701191c48)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:20 +02:00
Michael Niedermayer
c2ec2994c3
avcodec/proresdec: Consider negative bits left
Fixes: 70036/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_fuzzer-6298797647396864
Fixes: shift exponent 40 is too large for 32-bit type 'uint32_t' (aka 'unsigned int')

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 419eee63565f81aca67b29582297841c59deaab8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:20 +02:00
Michael Niedermayer
b158f7c62b
avcodec/alsdec: Clear shift_value
(the exact issue is unreproducable but the use of uninitialized data is reproducable)

Should fix: signed integer overflow: -2147483648 - 127 cannot be represented in type 'int'
Should fix: 69881/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-4751301204836352

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 6194cb87cb81ef97adfa2690e489f473182eaffe)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:19 +02:00
Michael Niedermayer
5c2dfe559e
avcodec/hevc/hevcdec: Do not allow slices to depend on failed slices
An alternative would be to leave the context unchanged on failure of hls_slice_header()

Fixes: out of array access
Fixes: NULL pointer dereference
Fixes: 69584/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5931086299856896
Fixes: 69724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5104066422702080
Fixes: 70422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5908731129298944

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 5d9544cfb03d8597aa2b0037def3a4679949cec6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:19 +02:00
Michael Niedermayer
e82aa42f6c
avformat/mov: add an EOF check in IPRP
Fixes: Timeout
Fixes: 69230/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6540512101203968

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 586f6fda1d814f0ddc32e652fde5e203d552f6d0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:19 +02:00
Michael Niedermayer
224dd41cce
avfilter/vf_xfade: Check ff_inlink_consume_frame() for failure
Fixes: CID1458043 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 73ca4e75eb0ae7d15965b90ffe7c041443a0421f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:18 +02:00
Michael Niedermayer
dc2b488fc7
avutil/slicethread: Check pthread_*_init() for failure
Fixes: CID1604383 Unchecked return value
Fixes: CID1604439 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 23851c9ee0f231122c58955e795e17cfe8ca5d98)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:18 +02:00
Michael Niedermayer
d7b229b387
avutil/frame: Check log2_crop_align
Fixes: CID1604586 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 15540b3d28676d5e797764a04f6681dcd01736f8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:18 +02:00
Michael Niedermayer
634744ca91
avutil/buffer: Check ff_mutex_init() for failure
Fixes: CID1604487 Unchecked return value
Fixes: CID1604494 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 82f5b20ff5be4fccbf42f4b90f155db0076c0462)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:17 +02:00
Michael Niedermayer
1ad6cf075d
avformat/xmv: Check this_packet_size
Fixes: CID1604489 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 696685df0ccf437083d15f40358a6ec86f5748ac)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:17 +02:00
Michael Niedermayer
2248217d42
avformat/webpenc: Check filesize in trailer
not sure this is possible

Fixes: CID1604446 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7734c583f777fdba2f6463cf525385ebe5cf10db)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:17 +02:00
Michael Niedermayer
591680a0cf
avformat/ty: rec_size seems to only need 32bit
May help CID1604560 Overflowed integer argument

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit be30913538d4be9a50672ceb683f8745d8aa75a9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:16 +02:00
Michael Niedermayer
2a59fc5b18
avformat/tty: Check avio_size()
Fixes: CID1220824 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 41745e550a0274571bd9fbfb12b36ff1743d4e9c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:16 +02:00
Michael Niedermayer
db71fb1549
avformat/siff: Basic pkt_size check
Fixes: half of CID1258461 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 124a97dd8b7636fb52e042b2e85a44cce40ab5e7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:16 +02:00
Michael Niedermayer
68770bfe17
avformat/sauce: Check avio_size() for failure
Fixes: CID1604592 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 759aae590c0298414db4d2925a33b084d7f9e7f9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:15 +02:00
Michael Niedermayer
d0937f480e
avformat/sapdec: Check ffurl_get_file_handle() for error
Fixes: CID1604506 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e305a0e703843765d4dd7042092c3a38c0f97af)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:15 +02:00
Michael Niedermayer
400fff4ba7
avformat/nsvdec: Check asize for PCM
Fixes: CID1604527 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e83e24650489e63f6b31e8c72a973db6367947b9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:15 +02:00
Michael Niedermayer
8804d76aa5
avformat/mp3dec: Check header_filesize
Fixes: CID1608714 Division or modulo by float zero

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cea4dbc903eaf8cb7a4ea53b281deff495ff8fa0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:14 +02:00
Michael Niedermayer
e86687bd6c
avformat/mp3dec; Check for avio_size() failure
Fixes: CID1608710 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bb936a1a720856a51c48bf907475daa8065920c9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:14 +02:00
Michael Niedermayer
6b772034ff
avformat/mov: Use 64bit for str_size
We assign a 64bit variable to it before checking

Fixes: CID1604544 Overflowed integer argument

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 046d069552f5c2824f36fcf95d409670208dc94b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:14 +02:00
Michael Niedermayer
1b4795df08
avformat/mm: Check length
Fixes: CID1220824 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 139bf412464e62a83984cd49093936dcaa7a0865)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:13 +02:00
Michael Niedermayer
0a6d42ce38
avformat/hnm: Check *chunk_size
Fixes: CID1604419 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 291356f58b8a1af491c692a89e6c4e70e9496f9d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:13 +02:00
Michael Niedermayer
444789f647
avformat/hlsenc: Check ret
Fixes: CID1609624 Unused value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7e577165c101513b4d8afe164e604cbef6901546)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:13 +02:00
Michael Niedermayer
9350f387e8
avformat/bintext: Check avio_size() return
Fixes: CID1604503 Overflowed constant
Fixes: CID1604566 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bf61f811e73dc62d1b53ed4ef6044b4e9e195113)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:12 +02:00
Michael Niedermayer
0e529f8a93
avformat/asfdec_o: Check size of index object
We subtract 24 so it must be at least 24

Fixes: CID1604482 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 891bc070f0294e564a02f9a71f6591b6a62c90cc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:12 +02:00
Michael Niedermayer
640f35b83e
avfilter/vf_scale: Check ff_scale_adjust_dimensions() for failure
Helps: CID1513722 Operands don't affect result

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2a8fb3c2cc07e741bca556eee8aea704fda4c33f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:12 +02:00
Michael Niedermayer
a841e90cfd
avfilter/scale_eval: Use 64bit, check values in ff_scale_adjust_dimensions()
Found by reviewing CID1513722 Operands don't affect result

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ad9df8bcfebc1085cb8b42dae9ab688af824cdab)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:11 +02:00
Michael Niedermayer
e2ba5abaa7
avfilter/vf_lut3d: Check av_scanf()
Fixes: CID1604398 Unchecked return value
Fixes: CID1604542 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ace2e25720b8a26906b15aab7eebbac860bb7bf0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:11 +02:00
Michael Niedermayer
893992cf00
avfilter/vf_elbg: Use unsigned for shifting into the top bit
Fixes: part of CID1355110 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2af95b9214a6bf75f946440d36c349963396e23b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:11 +02:00
Michael Niedermayer
be3e6ba7ad
avfilter/vf_premultiply: Use AV_PIX_MAX_PLANES
Helps: CID1435164 Out-of-bounds read
Helps: CID1435165 Out-of-bounds read
Helps: CID1435167 Out-of-bounds read
Helps: CID1435169 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 05e21b89024301f3fcf97b349ffe2ae4a80c83b6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:10 +02:00
Michael Niedermayer
39d083cb73
avfilter/vf_deshake_opencl: Ensure that the first iteration initializes the best variables
Fixes: CID1452759 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9385847af47211e8c618198499ffea99614bb55d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:10 +02:00
Michael Niedermayer
ca19dbf33d
avformat/iamf_parse: Check for negative sample sizes
Fixes: index -2 out of bounds for type 'const enum AVCodecID [3]'
Fixes: 69866/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4971166119821312

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 9b9e02f2ff6575e934e8e991a471b3086d1c0d53)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:36:07 +02:00
Michael Niedermayer
b926b87f3c
swscale/output: Fix integer overflows in yuv2rgba64_X_c_template
Fixes: signed integer overflow: -1082982400 + -1068681048 cannot be represented in type 'int'
Fixes: 69995/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6285740271534080

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 bcab9789ef750670277956e79736bca442aec2ff)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:34:44 +02:00
Michael Niedermayer
175c3d6cc5
avformat/mxfdec: Reorder elements of expression in bisect loop
Fixes: signed integer overflow: 9223372036854775807 - -1 cannot be represented in type 'long'
Fixes: 68578/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6032171648221184

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 d8d288479d3431d65318d957aab710b13714fc05)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:34:44 +02:00
Michael Niedermayer
76779f2b87
avutil/timecode: Use a 64bit framenum internally
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 68550/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6424065930756096

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 d5ca373d7efa37d2d3911f0afbc85fad0dc86b38)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:34:44 +02:00
Michael Niedermayer
587acd0d40
avcodec/pnmdec: Use 64bit for input size check
Fixes: out of array read
Fixes: poc3

Reported-by: VulDB CNA Team
Found-by: CookedMelon
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3faadbe2a27e74ff5bb5f7904ec27bb1f5287dc8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:34:43 +02:00
Michael Niedermayer
996ce2b379
avformat/mov: Check extradata in mov_read_iacb()
Fixes: MemLeak
Fixes: 69853/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4660448545275904

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 167bf8f61e671833c9d1234f12973e71c414b621)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:34:43 +02:00
Michael Niedermayer
b10323ef64
avcodec/mpeg12enc: Use av_rescale() in vbv_buffer_size computation
Fixes: signed integer overflow: 20 * 2314885530818453759 cannot be represented in type 'long'
Fixes: 69098/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-6107989688778752

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 0993ef675f06042402a97b08a60155c65dae8ba7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:34:43 +02:00
Michael Niedermayer
964a3e2fa7
avcodec/utvideoenc: Use unsigned shift to build flags
Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 69083/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_fuzzer-5608202363273216

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 69e90491f15d8eef643f8dfd1b75805829496678)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-25 20:34:42 +02:00