aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-08-21 20:30:34 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-25 03:29:36 +0200
commit2f07937926e52e328ade0aeb40f61d994b41ed9d (patch)
tree8d999a9811813dbb8a9f718bb421ddf71fe86cbd
parent4943abe05110562870b9f4d5e0ac85feb9ae2a63 (diff)
downloadffmpeg-2f07937926e52e328ade0aeb40f61d994b41ed9d.tar.gz
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@niedermayer.cc> (cherry picked from commit 67318187fbba382d887f9581dde48a50842f1bea) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wmalosslessdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 6b4edfc6fd..7eb7b4cd30 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