You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
avformat/rmdec: sanity check coded_framesize
Fixes: signed integer overflow: -14671840 * 8224 cannot be represented in type 'int'
Fixes: 24793/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5101884323659776
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 aee8477c6b
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -167,7 +167,11 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
|
|||||||
avio_rb16(pb); /* version2 */
|
avio_rb16(pb); /* version2 */
|
||||||
avio_rb32(pb); /* header size */
|
avio_rb32(pb); /* header size */
|
||||||
flavor= avio_rb16(pb); /* add codec info / flavor */
|
flavor= avio_rb16(pb); /* add codec info / flavor */
|
||||||
ast->coded_framesize = coded_framesize = avio_rb32(pb); /* coded frame size */
|
coded_framesize = avio_rb32(pb); /* coded frame size */
|
||||||
|
if (coded_framesize < 0)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
ast->coded_framesize = coded_framesize;
|
||||||
|
|
||||||
avio_rb32(pb); /* ??? */
|
avio_rb32(pb); /* ??? */
|
||||||
bytes_per_minute = avio_rb32(pb);
|
bytes_per_minute = avio_rb32(pb);
|
||||||
if (version == 4) {
|
if (version == 4) {
|
||||||
|
Reference in New Issue
Block a user