diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-19 09:21:15 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-01-14 11:36:33 +0100 |
commit | 089b3d6815a8b8f720482b907f526300d5dd7927 (patch) | |
tree | 818074812cf099f5fc69811c29985b813c918670 | |
parent | 14cf33e957fb17959ecc3a6953022eabf2489b5b (diff) | |
download | ffmpeg-089b3d6815a8b8f720482b907f526300d5dd7927.tar.gz |
interplayvideo: return meaningful error codes.
-rw-r--r-- | libavcodec/interplayvideo.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 3f098ac31d..012df378af 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -74,11 +74,11 @@ static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y) + delta_x * (1 + s->is_16bpp); if (motion_offset < 0) { av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset < 0 (%d)\n", motion_offset); - return -1; + return AVERROR_INVALIDDATA; } else if (motion_offset > s->upper_motion_limit_offset) { av_log(s->avctx, AV_LOG_ERROR, " Interplay video: motion offset above limit (%d >= %d)\n", motion_offset, s->upper_motion_limit_offset); - return -1; + return AVERROR_INVALIDDATA; } if (src->data[0] == NULL) { av_log(s->avctx, AV_LOG_ERROR, "Invalid decode type, corrupted header?\n"); @@ -959,6 +959,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; IpvideoContext *s = avctx->priv_data; + int ret; /* decoding map contains 4 bits of information per 8x8 block */ s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2); @@ -973,9 +974,9 @@ static int ipvideo_decode_frame(AVCodecContext *avctx, buf_size - s->decoding_map_size); s->current_frame.reference = 3; - if (ff_get_buffer(avctx, &s->current_frame)) { + if ((ret = ff_get_buffer(avctx, &s->current_frame)) < 0) { av_log(avctx, AV_LOG_ERROR, " Interplay Video: get_buffer() failed\n"); - return -1; + return ret; } if (!s->is_16bpp) { |