[FFmpeg-cvslog] cavsdec: check ff_get_buffer() return value

Anton Khirnov git at videolan.org
Tue Feb 4 06:32:05 CET 2014


ffmpeg | branch: release/1.1 | Anton Khirnov <anton at khirnov.net> | Thu Nov 28 10:54:35 2013 +0100| [969028870c6f5a2ed953bfca8cb68c24ffd9c824] | committer: Sean McGovern

cavsdec: check ff_get_buffer() return value

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable at libav.org

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=969028870c6f5a2ed953bfca8cb68c24ffd9c824
---

 libavcodec/cavsdec.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 15a05c8..c68f7b2 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -928,6 +928,7 @@ static inline int check_for_slice(AVSContext *h)
 
 static int decode_pic(AVSContext *h)
 {
+    int ret;
     int skip_count    = -1;
     enum cavs_mb mb_type;
 
@@ -965,7 +966,9 @@ static int decode_pic(AVSContext *h)
     if (h->cur.f->data[0])
         h->avctx->release_buffer(h->avctx, h->cur.f);
 
-    ff_get_buffer(h->avctx, h->cur.f);
+    ret = ff_get_buffer(h->avctx, h->cur.f);
+    if (ret < 0)
+        return ret;
 
     if (!h->edge_emu_buffer) {
         int alloc_size = FFALIGN(FFABS(h->cur.f->linesize[0]) + 32, 32);



More information about the ffmpeg-cvslog mailing list