[FFmpeg-cvslog] wavpack: report if there is no bits left

Christophe Gisquet git at videolan.org
Sat Aug 30 22:11:53 CEST 2014


ffmpeg | branch: release/1.1 | Christophe Gisquet <christophe.gisquet at gmail.com> | Tue Aug 19 12:26:47 2014 +0000| [3231e7ab64efaf073037f2bab08f0e8b1f0116d0] | committer: Michael Niedermayer

wavpack: report if there is no bits left

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 11a39bdf534a4ead634b4a593c66ebf756910b9b)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3231e7ab64efaf073037f2bab08f0e8b1f0116d0
---

 libavcodec/wavpack.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 36f3ad7..2493089 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -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;
 }



More information about the ffmpeg-cvslog mailing list