[FFmpeg-cvslog] avcodec/shorten: if allocation fails reset max_frame_size

Paul B Mahol git at videolan.org
Fri Apr 8 10:07:16 CEST 2016


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Apr  8 09:59:05 2016 +0200| [ae8a13c560226f96544a07eb736014b3b5abb1d6] | committer: Paul B Mahol

avcodec/shorten: if allocation fails reset max_frame_size

Otherwise crash happens.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae8a13c560226f96544a07eb736014b3b5abb1d6
---

 libavcodec/shorten.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 9da04eb..1d22a24 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);
         }



More information about the ffmpeg-cvslog mailing list