git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ec075c
)
wmaenc: require a large enough output buffer to prevent overwrites
author
Justin Ruggles
<justin.ruggles@gmail.com>
Fri, 2 Mar 2012 21:33:33 +0000
(16:33 -0500)
committer
Justin Ruggles
<justin.ruggles@gmail.com>
Sat, 3 Mar 2012 23:20:10 +0000
(18:20 -0500)
The maximum theoretical frame size is around 17000 bytes. Although in
practice it will generally be much smaller, we require a larger buffer
just to be safe.
CC: libav-stable@libav.org
libavcodec/wmaenc.c
patch
|
blob
|
history
diff --git
a/libavcodec/wmaenc.c
b/libavcodec/wmaenc.c
index
99544c0
..
5135b98
100644
(file)
--- a/
libavcodec/wmaenc.c
+++ b/
libavcodec/wmaenc.c
@@
-365,6
+365,11
@@
static int encode_superframe(AVCodecContext *avctx,
}
}
+ if (buf_size < 2 * MAX_CODED_SUPERFRAME_SIZE) {
+ av_log(avctx, AV_LOG_ERROR, "output buffer size is too small\n");
+ return AVERROR(EINVAL);
+ }
+
#if 1
total_gain= 128;
for(i=64; i; i>>=1){