cavsdec: check ff_get_buffer() return value

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
This commit is contained in:
Anton Khirnov 2013-11-28 10:54:35 +01:00
parent 50079a6aa9
commit 4736d003fa
1 changed files with 5 additions and 2 deletions

View File

@ -928,6 +928,7 @@ static inline int check_for_slice(AVSContext *h)
static int decode_pic(AVSContext *h) static int decode_pic(AVSContext *h)
{ {
int ret;
int skip_count = -1; int skip_count = -1;
enum cavs_mb mb_type; enum cavs_mb mb_type;
@ -964,8 +965,10 @@ static int decode_pic(AVSContext *h)
skip_bits(&h->gb, 1); //marker_bit skip_bits(&h->gb, 1); //marker_bit
} }
ff_get_buffer(h->avctx, h->cur.f, h->cur.f->pict_type == AV_PICTURE_TYPE_B ? ret = ff_get_buffer(h->avctx, h->cur.f, h->cur.f->pict_type == AV_PICTURE_TYPE_B ?
0 : AV_GET_BUFFER_FLAG_REF); 0 : AV_GET_BUFFER_FLAG_REF);
if (ret < 0)
return ret;
if (!h->edge_emu_buffer) { if (!h->edge_emu_buffer) {
int alloc_size = FFALIGN(FFABS(h->cur.f->linesize[0]) + 32, 32); int alloc_size = FFALIGN(FFABS(h->cur.f->linesize[0]) + 32, 32);