aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-13 23:21:24 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 00:21:50 +0200
commit9fb677dd825618fd5e44b955e7f8d2ad7333ab3d (patch)
treeab8ffdeb0b602fa497c7dbf834aa6505ccb5c16c
parent3ed0d94b827a67b91b727f2a58ed96e66d8ea2d7 (diff)
downloadffmpeg-9fb677dd825618fd5e44b955e7f8d2ad7333ab3d.tar.gz
avcodec/webp: Fix signedness in prefix_code check
Fixes: out of array read Fixes: 1557/clusterfuzz-testcase-minimized-6535013757616128 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 8c5cd1c9d33b4b287f85d42efb1aecfaee31de6c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/webp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index e2769c0bf9..147d85f15b 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -694,7 +694,7 @@ static int decode_entropy_coded_image(WebPContext *s, enum ImageRole role,
length = offset + get_bits(&s->gb, extra_bits) + 1;
}
prefix_code = huff_reader_get_symbol(&hg[HUFF_IDX_DIST], &s->gb);
- if (prefix_code > 39) {
+ if (prefix_code > 39U) {
av_log(s->avctx, AV_LOG_ERROR,
"distance prefix code too large: %d\n", prefix_code);
return AVERROR_INVALIDDATA;