aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/smacker.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-17 22:14:03 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-02-02 13:12:12 +0100
commitf54aab94a363489edcda492637d6e7409cc5446b (patch)
treebc82f405a57afd0df8b20717deaec2c6b5f1c4b6 /libavformat/smacker.c
parent92b194919199e6ea978ff6e120e9f9034b2bd299 (diff)
downloadffmpeg-f54aab94a363489edcda492637d6e7409cc5446b.tar.gz
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>
Diffstat (limited to 'libavformat/smacker.c')
-rw-r--r--libavformat/smacker.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 9966a67055..61209e7038 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -105,8 +105,8 @@ static int smacker_read_header(AVFormatContext *s)
height = avio_rl32(pb);
smk->frames = avio_rl32(pb);
pts_inc = avio_rl32(pb);
- if (pts_inc > INT_MAX / 100) {
- av_log(s, AV_LOG_ERROR, "pts_inc %d is too large\n", pts_inc);
+ if (pts_inc > INT_MAX / 100 || pts_inc == INT_MIN) {
+ av_log(s, AV_LOG_ERROR, "pts_inc %d is invalid\n", pts_inc);
return AVERROR_INVALIDDATA;
}