Skip to content
This repository has been archived by the owner on Apr 9, 2018. It is now read-only.

Commit

Permalink
prores: check slice mb_y against mb_height
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Oct 9, 2011
1 parent e1b2f6e commit 397d194
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libavcodec/proresdec_gpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ static int decode_picture_header(AVCodecContext *avctx, const uint8_t *buf, cons
}

ctx->mb_width = (avctx->width + 15) >> 4;
ctx->mb_height = (avctx->height + 15) >> 4;
if (ctx->frame_type)
ctx->mb_height = (avctx->height + 31) >> 5;
else
ctx->mb_height = (avctx->height + 15) >> 4;

slice_count = AV_RB16(buf + 5);

Expand Down Expand Up @@ -282,6 +285,12 @@ static int decode_picture_header(AVCodecContext *avctx, const uint8_t *buf, cons
}
}

if (mb_x || mb_y != ctx->mb_height) {
av_log(avctx, AV_LOG_ERROR, "error wrong mb count y %d h %d\n",
mb_y, ctx->mb_height);
return -1;
}

return pic_data_size;
}

Expand Down

0 comments on commit 397d194

Please sign in to comment.