aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol2016-04-08 09:59:05 +0200
committerPaul B Mahol2016-04-08 09:59:05 +0200
commitae8a13c560226f96544a07eb736014b3b5abb1d6 (patch)
tree2bb3caec224322320fc91afb9a98725e0a44d7be
parent3e99b377fc8bf19d8b8f0116554da403bba5ea91 (diff)
avcodec/shorten: if allocation fails reset max_frame_size
Otherwise crash happens. Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavcodec/shorten.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 9da04eb117..1d22a243c8 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -436,6 +436,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE);
if (!tmp_ptr) {
+ s->max_framesize = 0;
av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
return AVERROR(ENOMEM);
}