OSDN Git Service
(root)
/
coroid
/
libav_saccubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a11686
)
Fixed segfault with wavpack decoder on corrupted decorrelation terms sub-blocks.
author
Laurent Aimar
<fenrir@videolan.org>
Wed, 7 Sep 2011 19:43:03 +0000
(21:43 +0200)
committer
Martin Storsjö
<martin@martin.st>
Sat, 10 Sep 2011 15:58:57 +0000
(18:58 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/wavpack.c
patch
|
blob
|
history
diff --git
a/libavcodec/wavpack.c
b/libavcodec/wavpack.c
index
0604452
..
a687c27
100644
(file)
--- a/
libavcodec/wavpack.c
+++ b/
libavcodec/wavpack.c
@@
-863,12
+863,13
@@
static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
}
switch(id & WP_IDF_MASK){
case WP_ID_DECTERMS:
- s->terms = size;
- if(s->terms > MAX_TERMS){
+ if(size > MAX_TERMS){
av_log(avctx, AV_LOG_ERROR, "Too many decorrelation terms\n");
+ s->terms = 0;
buf += ssize;
continue;
}
+ s->terms = size;
for(i = 0; i < s->terms; i++) {
s->decorr[s->terms - i - 1].value = (*buf & 0x1F) - 5;
s->decorr[s->terms - i - 1].delta = *buf >> 5;