wavpack: report if there is no bits left
authorChristophe Gisquet <christophe.gisquet@gmail.com>
Tue, 19 Aug 2014 12:26:47 +0000 (12:26 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 30 Aug 2014 19:52:07 +0000 (21:52 +0200)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 11a39bdf534a4ead634b4a593c66ebf756910b9b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/wavpack.c

index 36f3ad7..2493089 100644 (file)
@@ -398,6 +398,10 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
     return sign ? ~ret : ret;
 
 error:
+    ret = get_bits_left(gb);
+    if (ret <= 0) {
+        av_log(ctx->avctx, AV_LOG_ERROR, "Too few bits (%d) left\n", ret);
+    }
     *last = 1;
     return 0;
 }