shorten: pad the internal bitstream buffer
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 1713eec29a)
This commit is contained in:
parent
3e3805b7fa
commit
f1a7bfea41
1 changed files with 1 additions and 1 deletions
|
|
@ -441,7 +441,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
|||
void *tmp_ptr;
|
||||
s->max_framesize = 1024; // 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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue