]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/faxcompr.c
avcodec/faxcompr: Check remaining bits on error in decode_group3_1d_line()
[ffmpeg] / libavcodec / faxcompr.c
index 3dd64cf73069e96d082b8fb938bface543f1950e..7bf11d80ca11e3d6fa19a111f26572ad6dd0f22b 100644 (file)
@@ -227,7 +227,7 @@ static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
             run       = 0;
             mode      = !mode;
         } else if ((int)t == -1) {
-            if (show_bits(gb, 12) == 15) {
+            if (get_bits_left(gb) > 12 && show_bits(gb, 12) == 15) {
                 int ret;
                 skip_bits(gb, 12);
                 ret = decode_uncompressed(avctx, gb, &pix_left, &runs, runend, &mode);