avcodec/svq3: Check av_mallocs return value
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 14 Jan 2015 12:23:20 +0000 (13:23 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 14 Jan 2015 12:23:20 +0000 (13:23 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/svq3.c

index 9459329..5fa370a 100644 (file)
@@ -1008,6 +1008,10 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
             }
 
             buf = av_malloc(buf_len);
+            if (!buf) {
+                ret = AVERROR(ENOMEM);
+                goto fail;
+            }
             av_log(avctx, AV_LOG_DEBUG, "watermark size: %ux%u\n",
                    watermark_width, watermark_height);
             av_log(avctx, AV_LOG_DEBUG,