diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-14 14:01:50 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-01-06 13:31:39 +0100 |
commit | b622e2b540ea12207b8704822530cf325c2be13a (patch) | |
tree | e409d4f3e7950ead1d12de365414ebf86d154ec5 | |
parent | 18009e60d273eb2e0184926812778e06985bf48e (diff) | |
download | ffmpeg-b622e2b540ea12207b8704822530cf325c2be13a.tar.gz |
anm: return meaningful error codes
-rw-r--r-- | libavcodec/anm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/anm.c b/libavcodec/anm.c index d08ed8d140..af148a6fd0 100644 --- a/libavcodec/anm.c +++ b/libavcodec/anm.c @@ -44,7 +44,7 @@ static av_cold int decode_init(AVCodecContext *avctx) s->frame.reference = 1; bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size); if (bytestream2_get_bytes_left(&s->gb) < 16 * 8 + 4 * 256) - return -1; + return AVERROR_INVALIDDATA; bytestream2_skipu(&s->gb, 16 * 8); for (i = 0; i < 256; i++) @@ -111,11 +111,11 @@ static int decode_frame(AVCodecContext *avctx, AnmContext *s = avctx->priv_data; const int buf_size = avpkt->size; uint8_t *dst, *dst_end; - int count; + int count, ret; - if(avctx->reget_buffer(avctx, &s->frame) < 0){ + if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0){ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return -1; + return ret; } dst = s->frame.data[0]; dst_end = s->frame.data[0] + s->frame.linesize[0]*avctx->height; |