aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-02-26 20:28:00 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 13:15:16 +0200
commit9061ea27c97e3156c373d235313d27f260aecbac (patch)
treeab766fa3ab0fed24bd31901a5e65c894aa07b39c
parentc9a15db1a97e0efb6905784702b043e3441d6fad (diff)
downloadffmpeg-9061ea27c97e3156c373d235313d27f260aecbac.tar.gz
avcodec/pictordec: Check plane value before doing value/mask computations
Fixes integer overflow Fixes: 675/clusterfuzz-testcase-6722971232108544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 63e400a8807dca7b0ffa3841df2e31f7419abb8d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/pictordec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c
index 7ae1a81607..988da37f33 100644
--- a/libavcodec/pictordec.c
+++ b/libavcodec/pictordec.c
@@ -77,10 +77,10 @@ static void picmemset(PicContext *s, AVFrame *frame, int value, int run,
if (*y < 0) {
*y = s->height - 1;
*plane += 1;
- value <<= bits_per_plane;
- mask <<= bits_per_plane;
if (*plane >= s->nb_planes)
return;
+ value <<= bits_per_plane;
+ mask <<= bits_per_plane;
}
}
}