From ae8a13c560226f96544a07eb736014b3b5abb1d6 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 8 Apr 2016 09:59:05 +0200 Subject: avcodec/shorten: if allocation fails reset max_frame_size Otherwise crash happens. Signed-off-by: Paul B Mahol --- libavcodec/shorten.c | 1 + 1 file changed, 1 insertion(+) 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); } -- cgit v1.2.1