Skip to content
Snippets Groups Projects
Commit b0e7a932 authored by Baptiste Coudurier's avatar Baptiste Coudurier Committed by Michael Niedermayer
Browse files

SVQ3: Check that things match up after a frame.

parent 8811679c
No related branches found
No related tags found
No related merge requests found
...@@ -932,7 +932,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, ...@@ -932,7 +932,7 @@ static int svq3_decode_frame(AVCodecContext *avctx,
H264Context *h = &svq3->h; H264Context *h = &svq3->h;
MpegEncContext *s = &h->s; MpegEncContext *s = &h->s;
int buf_size = avpkt->size; int buf_size = avpkt->size;
int m, mb_type; int m, mb_type, left;
/* special case for last picture */ /* special case for last picture */
if (buf_size == 0) { if (buf_size == 0) {
...@@ -1054,6 +1054,18 @@ static int svq3_decode_frame(AVCodecContext *avctx, ...@@ -1054,6 +1054,18 @@ static int svq3_decode_frame(AVCodecContext *avctx,
ff_draw_horiz_band(s, 16*s->mb_y, 16); 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); MPV_frame_end(s);
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment