aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-09 19:38:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-16 16:00:23 +0200
commit1cdc9447f423d468a97f6d1b84ed8321d6ef3713 (patch)
tree92f88a317141165c5d2848b6941f85a70dfa293c
parent528fb0b27d70b0b5a2d8a27bdd1f6798ae6876d0 (diff)
downloadffmpeg-1cdc9447f423d468a97f6d1b84ed8321d6ef3713.tar.gz
avcodec/cllc: Check prefix
Fixes: runtime error: left shift of 1610706944 by 1 places cannot be represented in type 'int' Fixes: 1421/clusterfuzz-testcase-minimized-6239947507892224 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 62c5949beca2c95d6af5c74985467438d2295a66) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/cllc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c
index 24fa168e36..97d3ae40ea 100644
--- a/libavcodec/cllc.c
+++ b/libavcodec/cllc.c
@@ -81,6 +81,10 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
count++;
}
+ if (prefix > (65535 - 256)/2) {
+ vlc->table = NULL;
+ return AVERROR_INVALIDDATA;
+ }
prefix <<= 1;
}