summaryrefslogtreecommitdiff
path: root/libavcodec/svq3.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2011-05-05 14:40:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-05 15:43:58 +0200
commitb0e7a932e6ea9bb83e7e15c4cd4c1bda110d16e2 (patch)
treeb0bffd66509ae2750739622c13f6d31b811d21ee /libavcodec/svq3.c
parent8811679c8e6bcb5911f4749594c31e7fd1f5dfff (diff)
downloadffmpeg-b0e7a932e6ea9bb83e7e15c4cd4c1bda110d16e2.tar.gz
SVQ3: Check that things match up after a frame.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/svq3.c')
-rw-r--r--libavcodec/svq3.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 393c7b40ec..9dff9e9114 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -932,7 +932,7 @@ static int svq3_decode_frame(AVCodecContext *avctx,
H264Context *h = &svq3->h;
MpegEncContext *s = &h->s;
int buf_size = avpkt->size;
- int m, mb_type;
+ int m, mb_type, left;
/* special case for last picture */
if (buf_size == 0) {
@@ -1054,6 +1054,18 @@ static int svq3_decode_frame(AVCodecContext *avctx,
ff_draw_horiz_band(s, 16*s->mb_y, 16);
}
+ left = buf_size*8 - get_bits_count(&s->gb);
+
+ if (s->mb_y != s->mb_height || s->mb_x != s->mb_width) {
+ av_log(avctx, AV_LOG_INFO, "frame num %d incomplete pic x %d y %d left %d\n", avctx->frame_number, s->mb_y, s->mb_x, left);
+ //av_hex_dump(stderr, buf+buf_size-8, 8);
+ }
+
+ if (left < 0) {
+ av_log(avctx, AV_LOG_ERROR, "frame num %d left %d\n", avctx->frame_number, left);
+ return -1;
+ }
+
MPV_frame_end(s);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {