mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avformat/smacker: Check for too small pts_inc
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_SMACKER_fuzzer-6705429132476416 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 f54aab94a363489edcda492637d6e7409cc5446b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
32c6304cf0
commit
bbb5494801
@ -104,8 +104,8 @@ static int smacker_read_header(AVFormatContext *s)
|
|||||||
height = avio_rl32(pb);
|
height = avio_rl32(pb);
|
||||||
smk->frames = avio_rl32(pb);
|
smk->frames = avio_rl32(pb);
|
||||||
pts_inc = avio_rl32(pb);
|
pts_inc = avio_rl32(pb);
|
||||||
if (pts_inc > INT_MAX / 100) {
|
if (pts_inc > INT_MAX / 100 || pts_inc == INT_MIN) {
|
||||||
av_log(s, AV_LOG_ERROR, "pts_inc %d is too large\n", pts_inc);
|
av_log(s, AV_LOG_ERROR, "pts_inc %d is invalid\n", pts_inc);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user