aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-04-27 20:16:13 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-10 01:52:56 +0200
commitfc097bf1cd0af7bbab09e2f1af4ae39eb0ca4eea (patch)
tree71042e87a522ee733475e559514a26f3efa623f9
parentc10babcadc341b8bec6b16572e4373ae571af7e7 (diff)
downloadffmpeg-fc097bf1cd0af7bbab09e2f1af4ae39eb0ca4eea.tar.gz
avcodec/g2meet: Check RGB upper limit
Fixes: runtime error: left shift of 1876744317 by 16 places cannot be represented in type 'int' Fixes: 6799/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5115274731716608 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 4dd2c8b9ea46b4e008a8bfc2077834428cd5a17c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/g2meet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index 14dd05babc..fed35a271b 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -555,7 +555,7 @@ static uint32_t epic_decode_pixel_pred(ePICContext *dc, int x, int y,
B = ((pred >> B_shift) & 0xFF) - TOSIGNED(delta);
}
- if (R<0 || G<0 || B<0) {
+ if (R<0 || G<0 || B<0 || R > 255 || G > 255 || B > 255) {
av_log(NULL, AV_LOG_ERROR, "RGB %d %d %d is out of range\n", R, G, B);
return 0;
}