ansi: check ff_set_dimensions return value
authorVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 12 Nov 2014 10:13:06 +0000 (11:13 +0100)
committerLuca Barbato <lu_zero@gentoo.org>
Mon, 12 Jan 2015 23:16:41 +0000 (00:16 +0100)
CC: libav-stable@libav.org
Bug-Id: CID 1135737
(cherry picked from commit 994ab1804b8bf532f44876927b07b51f1f63247f)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/ansi.c

index 95b5be4..556bfe4 100644 (file)
@@ -88,9 +88,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
     s->fg          = DEFAULT_FG_COLOR;
     s->bg          = DEFAULT_BG_COLOR;
 
-    if (!avctx->width || !avctx->height)
-        ff_set_dimensions(avctx, 80 << 3, 25 << 4);
-
+    if (!avctx->width || !avctx->height) {
+        int ret = ff_set_dimensions(avctx, 80 << 3, 25 << 4);
+        if (ret < 0)
+            return ret;
+    }
     return 0;
 }