avcodec/rangecoder: Fix range coder corner case handling
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 12 May 2017 23:45:29 +0000 (01:45 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 12 May 2017 23:46:05 +0000 (01:46 +0200)
Fixes: 1511/clusterfuzz-testcase-minimized-5906663800307712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/rangecoder.c

index d7a2774..0bb79c8 100644 (file)
@@ -60,7 +60,7 @@ av_cold void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf,
     c->bytestream += 2;
     if (c->low >= 0xFF00) {
         c->low = 0xFF00;
-        c->bytestream_end = c->bytestream + 2;
+        c->bytestream_end = c->bytestream;
     }
 }