From 688b132b881d423877e38dc82f17e23a604be676 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 19 Nov 2012 10:38:03 +0100 Subject: qdrw: return meaningful error codes. --- libavcodec/qdrw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libavcodec/qdrw.c') diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index ca982f340d..e7337a5766 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -45,7 +45,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame * const p = &a->pic; uint8_t* outdata; int colors; - int i; + int i, ret; uint32_t *pal; int r, g, b; @@ -53,9 +53,9 @@ static int decode_frame(AVCodecContext *avctx, avctx->release_buffer(avctx, p); p->reference= 0; - if(ff_get_buffer(avctx, p) < 0){ + if ((ret = ff_get_buffer(avctx, p)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return -1; + return ret; } p->pict_type= AV_PICTURE_TYPE_I; p->key_frame= 1; @@ -70,7 +70,7 @@ static int decode_frame(AVCodecContext *avctx, if(colors < 0 || colors > 256) { av_log(avctx, AV_LOG_ERROR, "Error color count - %i(0x%X)\n", colors, colors); - return -1; + return AVERROR_INVALIDDATA; } if (buf_end - buf < (colors + 1) * 8) return AVERROR_INVALIDDATA; -- cgit v1.2.3