[FFmpeg-cvslog] libavcodec/wmalosslessdec: Check the remaining bits

Michael Niedermayer git at videolan.org
Thu Aug 25 05:21:45 EEST 2016


ffmpeg | branch: release/3.1 | Michael Niedermayer <michael at niedermayer.cc> | Sun Aug 21 20:30:34 2016 +0200| [2f07937926e52e328ade0aeb40f61d994b41ed9d] | committer: Michael Niedermayer

libavcodec/wmalosslessdec: Check the remaining bits

Fixes assertion failure
Fixes: 24ebfda03228b5cc1ef792608cfba458/signal_sigabrt_7ffff6ae7c37_6473_3fa8a111dbc752b1a7c411c5ab79aaa4.wma

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 67318187fbba382d887f9581dde48a50842f1bea)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/wmalosslessdec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 6b4edfc..7eb7b4c 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -1271,6 +1271,11 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
         }
     }
 
+    if (remaining_bits(s, gb) < 0) {
+        av_log(avctx, AV_LOG_ERROR, "Overread %d\n", -remaining_bits(s, gb));
+        s->packet_loss = 1;
+    }
+
     if (s->packet_done && !s->packet_loss &&
         remaining_bits(s, gb) > 0) {
         /* save the rest of the data so that it can be decoded



More information about the ffmpeg-cvslog mailing list