ansi: check ff_set_dimensions return value

Message ID 20141113004710.7C3775DFC1@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau Nov. 13, 2014, 12:47 a.m.
Module: libav
Branch: master
Commit: 994ab1804b8bf532f44876927b07b51f1f63247f

Author:    Vittorio Giovara <vittorio.giovara@gmail.com>
Committer: Vittorio Giovara <vittorio.giovara@gmail.com>
Date:      Wed Nov 12 11:13:06 2014 +0100

ansi: check ff_set_dimensions return value

CC: libav-stable@libav.org
Bug-Id: CID 1135737

---

 libavcodec/ansi.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
index 95b5be4..556bfe4 100644
--- a/libavcodec/ansi.c
+++ b/libavcodec/ansi.c
@@ -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;
 }