OSDN Git Service

avcodec/shorten: if allocation fails reset max_frame_size
authorPaul B Mahol <onemda@gmail.com>
Fri, 8 Apr 2016 07:59:05 +0000 (09:59 +0200)
committerPaul B Mahol <onemda@gmail.com>
Fri, 8 Apr 2016 07:59:05 +0000 (09:59 +0200)
Otherwise crash happens.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/shorten.c

index 9da04eb..1d22a24 100644 (file)
@@ -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);
         }