summaryrefslogtreecommitdiff
path: root/libavcodec/shorten.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-07 19:57:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-07 20:05:53 +0200
commit89d998f1c1eddac3a1256e28ac00ccfdf4d3edd1 (patch)
tree6acabff56368430ad57475490eb60258db68ff1d /libavcodec/shorten.c
parentd23b8462b5a4a9da78ed45c4a7a3b35d538df909 (diff)
shorten: allocate space for padding
Fixes array overread Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r--libavcodec/shorten.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 1d3b6eb1bb..23c5d7cf9b 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -424,7 +424,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
void *tmp_ptr;
s->max_framesize = 8192; // should hopefully be enough for the first header
tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
- s->max_framesize);
+ s->max_framesize + FF_INPUT_BUFFER_PADDING_SIZE);
if (!tmp_ptr) {
av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
return AVERROR(ENOMEM);