aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-11-15 18:18:40 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-26 16:58:33 +0100
commitbe280f3e8b22f7283fc3787ead22575754f1c866 (patch)
treeb87e2f59ffb3a39dc4ca348e2cfe3de5a6677f22
parent2b0cda395f2330fc0dbebadb612b758bf46ccf47 (diff)
downloadffmpeg-be280f3e8b22f7283fc3787ead22575754f1c866.tar.gz
avcodec/wmaprodec: Check for overread in decode_packet()
Fixes assertion failure Fixes: 0256e92df2df7e933b43a2c70e4c8040/signal_sigabrt_7ffff6ae7cc9_1358_999ac18684788221490757582ce9af84.wma Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 7ad698e24e6b9dde57c4e01c145bcddfe9d6e4a3) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wmaprodec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index cc7ad0d408..a94da0f67c 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1623,6 +1623,11 @@ static int decode_packet(AVCodecContext *avctx, void *data,
s->packet_done = 1;
}
+ 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