mpc8: do not leave padding after last frame in buffer for the next decode call
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 7 Aug 2012 18:22:57 +0000 (20:22 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 8 Aug 2012 07:11:38 +0000 (09:11 +0200)
libavcodec/mpc8.c

index 915a785..79225c4 100644 (file)
@@ -411,6 +411,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
     c->cur_frame++;
 
     c->last_bits_used = get_bits_count(gb);
+    if(get_bits_left(gb) < 8) // we have only padding left
+        c->last_bits_used = buf_size << 3;
     if(c->cur_frame >= c->frames)
         c->cur_frame = 0;