ff_vp56_init_dequant(s, vp56_rac_gets(c, 6));
if (s->frames[VP56_FRAME_CURRENT]->key_frame)
{
+ int render_x, render_y;
+
vp56_rac_gets(c, 8);
if(vp56_rac_gets(c, 5) > 5)
return AVERROR_INVALIDDATA;
cols << 4, rows << 4);
return AVERROR_INVALIDDATA;
}
- vp56_rac_gets(c, 8); /* number of displayed macroblock rows */
- vp56_rac_gets(c, 8); /* number of displayed macroblock cols */
+ render_y = vp56_rac_gets(c, 8); /* number of displayed macroblock rows */
+ render_x = vp56_rac_gets(c, 8); /* number of displayed macroblock cols */
+ if (render_x == 0 || render_x > cols ||
+ render_y == 0 || render_y > rows)
+ return AVERROR_INVALIDDATA;
vp56_rac_gets(c, 2);
if (!s->macroblocks || /* first frame */
16*cols != s->avctx->coded_width ||
return 0;
}
-AVCodec ff_vp5_decoder = {
+const AVCodec ff_vp5_decoder = {
.name = "vp5",
.long_name = NULL_IF_CONFIG_SMALL("On2 VP5"),
.type = AVMEDIA_TYPE_VIDEO,