summaryrefslogtreecommitdiff
path: root/libavcodec/indeo2.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-11-17 08:08:40 +0100
committerAnton Khirnov <anton@khirnov.net>2013-01-06 13:31:40 +0100
commit7b1fbd4729a52dd7c02622dbe7bb81a6a7ed12f8 (patch)
tree766aa1c1feafc0b6c13206f6fa9baf67b10f9d44 /libavcodec/indeo2.c
parent6ea2c9a4cf9fb0abd085825724e54b691f773251 (diff)
indeo2: check decoding errors.
Diffstat (limited to 'libavcodec/indeo2.c')
-rw-r--r--libavcodec/indeo2.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index 83e1f604b2..46d582f7af 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -176,21 +176,34 @@ static int ir2_decode_frame(AVCodecContext *avctx,
init_get_bits(&s->gb, buf + start, (buf_size - start) * 8);
if (s->decode_delta) { /* intraframe */
- ir2_decode_plane(s, avctx->width, avctx->height,
- s->picture.data[0], s->picture.linesize[0], ir2_luma_table);
+ if ((ret = ir2_decode_plane(s, avctx->width, avctx->height,
+ s->picture.data[0], s->picture.linesize[0],
+ ir2_luma_table)) < 0)
+ return ret;
+
/* swapped U and V */
- ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
- s->picture.data[2], s->picture.linesize[2], ir2_luma_table);
- ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
- s->picture.data[1], s->picture.linesize[1], ir2_luma_table);
+ if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
+ s->picture.data[2], s->picture.linesize[2],
+ ir2_luma_table)) < 0)
+ return ret;
+ if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
+ s->picture.data[1], s->picture.linesize[1],
+ ir2_luma_table)) < 0)
+ return ret;
} else { /* interframe */
- ir2_decode_plane_inter(s, avctx->width, avctx->height,
- s->picture.data[0], s->picture.linesize[0], ir2_luma_table);
+ if ((ret = ir2_decode_plane_inter(s, avctx->width, avctx->height,
+ s->picture.data[0], s->picture.linesize[0],
+ ir2_luma_table)) < 0)
+ return ret;
/* swapped U and V */
- ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
- s->picture.data[2], s->picture.linesize[2], ir2_luma_table);
- ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
- s->picture.data[1], s->picture.linesize[1], ir2_luma_table);
+ if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
+ s->picture.data[2], s->picture.linesize[2],
+ ir2_luma_table)) < 0)
+ return ret;
+ if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
+ s->picture.data[1], s->picture.linesize[1],
+ ir2_luma_table)) < 0)
+ return ret;
}
*picture = s->picture;