Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-09-15 01:20:38 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2018-10-03 13:32:56 +0300
commit49023147c7fcb8319830be698b280e65e82ddf22 (patch)
treedf54174d84cfa8d97f43453f8b0fbfa627066e94 /libavcodec/mpeg4videodec.c
parent79c018351e6e0a3e3f58b4b7831a6642c3a4f42c (diff)
avcodec/mpeg4videodec: Fix undefined shift in get_amv()
Fixes: runtime error: shift exponent -1 is negative Fixes: 9938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5653783529914368 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 c88afa44c4823aba7b6f4a1b01fd6a4169643c57) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mpeg4videodec.c')
-rw-r--r--libavcodec/mpeg4videodec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 23dde9ee85..936406d2d1 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -537,7 +537,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n)
len >>= s->quarter_sample;
if (s->real_sprite_warping_points == 1) {
- if (ctx->divx_version == 500 && ctx->divx_build == 413)
+ if (ctx->divx_version == 500 && ctx->divx_build == 413 && a >= s->quarter_sample)
sum = s->sprite_offset[0][n] / (1 << (a - s->quarter_sample));
else
sum = RSHIFT(s->sprite_offset[0][n] * (1 << s->quarter_sample), a);