From: Paul B Mahol Date: Fri, 8 Apr 2016 07:59:05 +0000 (+0200) Subject: avcodec/shorten: if allocation fails reset max_frame_size X-Git-Tag: android-x86-7.1-r1~5730 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ae8a13c560226f96544a07eb736014b3b5abb1d6;p=android-x86%2Fexternal-ffmpeg.git avcodec/shorten: if allocation fails reset max_frame_size Otherwise crash happens. Signed-off-by: Paul B Mahol --- 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); }