aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cavsdec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-11-28 10:54:35 +0100
committerAnton Khirnov <anton@khirnov.net>2014-01-06 08:22:48 +0100
commit4736d003fac30af4afd8390182f12f480ad78801 (patch)
treee96f6a355bbc6fda1f7b6af0f8e532be0a97da70 /libavcodec/cavsdec.c
parent50079a6aa93291e6dc9d9fb8d33da83f79e9311d (diff)
downloadffmpeg-4736d003fac30af4afd8390182f12f480ad78801.tar.gz
cavsdec: check ff_get_buffer() return value
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
Diffstat (limited to 'libavcodec/cavsdec.c')
-rw-r--r--libavcodec/cavsdec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 142b844cad..a8ed1920ed 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;
@@ -964,8 +965,10 @@ static int decode_pic(AVSContext *h)
skip_bits(&h->gb, 1); //marker_bit
}
- ff_get_buffer(h->avctx, h->cur.f, h->cur.f->pict_type == AV_PICTURE_TYPE_B ?
- 0 : AV_GET_BUFFER_FLAG_REF);
+ ret = ff_get_buffer(h->avctx, h->cur.f, h->cur.f->pict_type == AV_PICTURE_TYPE_B ?
+ 0 : AV_GET_BUFFER_FLAG_REF);
+ if (ret < 0)
+ return ret;
if (!h->edge_emu_buffer) {
int alloc_size = FFALIGN(FFABS(h->cur.f->linesize[0]) + 32, 32);