Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-03-03 01:33:33 +0400
committerReinhard Tartler <siretart@tauware.de>2012-04-01 20:33:27 +0400
commitc932844882f315928688c704fd9cdcb7eee37d17 (patch)
tree1e22e8bbc584a3dc9c8e6901ecc5aa0c2b3471b9 /libavcodec
parent433aaeb2f1cf679f254f5f1c7220b4100bc89c68 (diff)
wmaenc: require a large enough output buffer to prevent overwrites
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 (cherry picked from commit dfc4fdedf8cfc56a505579b1f2c1c5efbce4b97e) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wmaenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index 3cdb4a0b9b..a002c32b5d 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -355,6 +355,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){