diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-01 18:53:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-20 03:41:33 +0200 |
commit | 97458a040f88e918025ab1a390e9bc31c0bb080e (patch) | |
tree | ff9b53422b69cf1cb6788708554c1c8a93f07ba8 /libavcodec | |
parent | 7f5c9250de0e3a8a16cb9095833df22537dd03df (diff) | |
download | ffmpeg-97458a040f88e918025ab1a390e9bc31c0bb080e.tar.gz |
avcodec/indeo2: Check remaining bits in ir2_decode_plane()
Fixes: 1290/clusterfuzz-testcase-minimized-5815578902134784
Fixes: timeout
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 b29feec9829cfab2523c8d95e35bd69e689ea4af)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/indeo2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 5bf33aa90b..b8c7a84c6d 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -76,6 +76,8 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst for (j = 1; j < height; j++) { out = 0; + if (get_bits_left(&ctx->gb) <= 0) + return AVERROR_INVALIDDATA; while (out < width) { int c = ir2_get_code(&ctx->gb); if (c >= 0x80) { /* we have a skip */ @@ -115,6 +117,8 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_ for (j = 0; j < height; j++) { out = 0; + if (get_bits_left(&ctx->gb) <= 0) + return AVERROR_INVALIDDATA; while (out < width) { c = ir2_get_code(&ctx->gb); if (c >= 0x80) { /* we have a skip */ |