projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
afe0309
)
wmapro: make sure there is room to store the current packet
author
Luca Barbato
<lu_zero@gentoo.org>
Fri, 28 Jun 2013 02:03:47 +0000
(
04:03
+0200)
committer
Luca Barbato
<lu_zero@gentoo.org>
Fri, 28 Jun 2013 11:15:40 +0000
(13:15 +0200)
Prevent horrid and hard to trace struct overwrite.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
libavcodec/wmaprodec.c
patch
|
blob
|
history
diff --git
a/libavcodec/wmaprodec.c
b/libavcodec/wmaprodec.c
index
6a64641
..
8fdfbf8
100644
(file)
--- a/
libavcodec/wmaprodec.c
+++ b/
libavcodec/wmaprodec.c
@@
-1459,6
+1459,14
@@
static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
return;
}
+ if (len > put_bits_left(&s->pb)) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Cannot append %d bits, only %d bits available.\n",
+ len, put_bits_left(&s->pb));
+ s->packet_loss = 1;
+ return;
+ }
+
s->num_saved_bits += len;
if (!append) {
avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3),