svq3: propagate codec memory allocation failure in context init
authorDustin Brody <libav@parsoma.net>
Fri, 12 Aug 2011 16:05:46 +0000 (12:05 -0400)
committerAnton Khirnov <anton@khirnov.net>
Mon, 15 Aug 2011 19:26:34 +0000 (21:26 +0200)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/svq3.c

index f6f9fc1..3cd95ba 100644 (file)
@@ -924,7 +924,10 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
 
         h->b_stride = 4*s->mb_width;
 
-        ff_h264_alloc_tables(h);
+        if (ff_h264_alloc_tables(h) < 0) {
+            av_log(avctx, AV_LOG_ERROR, "svq3 memory allocation failed\n");
+            return AVERROR(ENOMEM);
+        }
     }
 
     return 0;