[libav-commits] svq1enc: check ff_get_buffer return value

Vittorio Giovara git at libav.org
Thu Nov 13 01:46:54 CET 2014


Module: libav
Branch: master
Commit: 59846452af762f6af5ced4399e8dcd709ca50fcd

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

svq1enc: check ff_get_buffer return value

CC: libav-stable at libav.org
Bug-Id: CID 747723

---

 libavcodec/svq1enc.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 361c465..d70bba3 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -580,8 +580,12 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     }
 
     if (!s->current_picture->data[0]) {
-        ff_get_buffer(avctx, s->current_picture, 0);
-        ff_get_buffer(avctx, s->last_picture, 0);
+        ret = ff_get_buffer(avctx, s->current_picture, 0);
+        if (ret < 0)
+            return ret;
+        ret = ff_get_buffer(avctx, s->last_picture, 0);
+        if (ret < 0)
+            return ret;
         s->scratchbuf = av_malloc(s->current_picture->linesize[0] * 16 * 2);
     }
 



More information about the libav-commits mailing list