projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
52835cb
)
avcodec/wavpack: Check L/R values before use to avoid harmless integer overflow and...
author
Michael Niedermayer
<michaelni@gmx.at>
Sun, 3 May 2015 13:54:21 +0000
(15:54 +0200)
committer
Michael Niedermayer
<michaelni@gmx.at>
Sun, 3 May 2015 14:37:10 +0000
(16:37 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/wavpack.c
patch
|
blob
|
history
diff --git
a/libavcodec/wavpack.c
b/libavcodec/wavpack.c
index
1ad3901
..
b51a21c
100644
(file)
--- a/
libavcodec/wavpack.c
+++ b/
libavcodec/wavpack.c
@@
-472,6
+472,14
@@
static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb,
s->decorr[i].samplesB[0] = L;
}
}
+
+ if (type == AV_SAMPLE_FMT_S16P) {
+ if (FFABS(L) + FFABS(R) > (1<<19)) {
+ av_log(s->avctx, AV_LOG_ERROR, "sample %d %d too large\n", L, R);
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
pos = (pos + 1) & 7;
if (s->joint)
L += (R -= (L >> 1));