summaryrefslogtreecommitdiffstats
path: root/libavcodec/interplayvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-14 15:04:58 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-14 15:04:58 +0100
commit8943925d1f68316218a9722c3f275ae1ae29b325 (patch)
tree455f017242d1ab01e0eb2e4ae981b79e986e2015 /libavcodec/interplayvideo.c
parent329675cfd71fab29e47ea9c64f3560f0305dbf36 (diff)
parent688b132b881d423877e38dc82f17e23a604be676 (diff)
downloadffmpeg-streaming-8943925d1f68316218a9722c3f275ae1ae29b325.zip
ffmpeg-streaming-8943925d1f68316218a9722c3f275ae1ae29b325.tar.gz
Merge commit '688b132b881d423877e38dc82f17e23a604be676'
* commit '688b132b881d423877e38dc82f17e23a604be676': qdrw: return meaningful error codes. qtrle: return a meaningful error code. gifdec: return meaningful error codes. interplayvideo: remove a static variable. interplayvideo: return meaningful error codes. lcldec: return meaningful error codes. targa: return meaningful error codes. qpeg: return a meaningful error code. nuv: return meaningful error codes. Conflicts: libavcodec/gifdec.c libavcodec/interplayvideo.c libavcodec/nuv.c libavcodec/qpeg.c libavcodec/targa.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/interplayvideo.c')
-rw-r--r--libavcodec/interplayvideo.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index f1a2a38..3285578 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, "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, "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");
@@ -882,12 +882,8 @@ static void ipvideo_decode_opcodes(IpvideoContext *s)
int x, y;
unsigned char opcode;
int ret;
- static int frame = 0;
GetBitContext gb;
- av_dlog(s->avctx, "frame %d\n", frame);
- frame++;
-
bytestream2_skip(&s->stream_ptr, 14); /* data starts 14 bytes in */
if (!s->is_16bpp) {
/* this is PAL8, so make the palette available */
@@ -923,7 +919,7 @@ static void ipvideo_decode_opcodes(IpvideoContext *s)
}
if (ret != 0) {
av_log(s->avctx, AV_LOG_ERROR, "decode problem on frame %d, @ block (%d, %d)\n",
- frame, x, y);
+ s->avctx->frame_number, x, y);
return;
}
}
@@ -963,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);
@@ -977,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, "get_buffer() failed\n");
- return -1;
+ return ret;
}
if (!s->is_16bpp) {
OpenPOWER on IntegriCloud