cols = buf[3]; /* number of stored macroblock cols */
/* buf[4] is number of displayed macroblock rows */
/* buf[5] is number of displayed macroblock cols */
+ if (!rows || !cols) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid size %dx%d\n", cols << 4, rows << 4);
+ return 0;
+ }
if (!s->macroblocks || /* first frame */
16*cols != s->avctx->coded_width ||
vrt_shift = 5;
s->sub_version = sub_version;
} else {
- if (!s->sub_version)
+ if (!s->sub_version || !s->avctx->coded_width || !s->avctx->coded_height)
return 0;
if (separated_coeff || !s->filter_header) {
if (coeff_idx)
break;
} else {
- if (get_bits_count(&s->gb) >= s->gb.size_in_bits)
+ if (get_bits_left(&s->gb) <= 0)
return;
coeff = get_vlc2(&s->gb, vlc_coeff->table, 9, 3);
if (coeff == 0) {
{
VP56Context *s = avctx->priv_data;
- ff_vp56_init(avctx, avctx->codec->id == CODEC_ID_VP6,
- avctx->codec->id == CODEC_ID_VP6A);
+ ff_vp56_init(avctx, avctx->codec->id == AV_CODEC_ID_VP6,
+ avctx->codec->id == AV_CODEC_ID_VP6A);
s->vp56_coord_div = vp6_coord_div;
s->parse_vector_adjustment = vp6_parse_vector_adjustment;
s->filter = vp6_filter;
AVCodec ff_vp6_decoder = {
.name = "vp6",
.type = AVMEDIA_TYPE_VIDEO,
- .id = CODEC_ID_VP6,
+ .id = AV_CODEC_ID_VP6,
.priv_data_size = sizeof(VP56Context),
.init = vp6_decode_init,
.close = vp6_decode_free,
.decode = ff_vp56_decode_frame,
.capabilities = CODEC_CAP_DR1,
- .long_name = NULL_IF_CONFIG_SMALL("On2 VP6"),
+ .long_name = NULL_IF_CONFIG_SMALL("On2 VP6"),
};
/* flash version, not flipped upside-down */
AVCodec ff_vp6f_decoder = {
.name = "vp6f",
.type = AVMEDIA_TYPE_VIDEO,
- .id = CODEC_ID_VP6F,
+ .id = AV_CODEC_ID_VP6F,
.priv_data_size = sizeof(VP56Context),
.init = vp6_decode_init,
.close = vp6_decode_free,
.decode = ff_vp56_decode_frame,
.capabilities = CODEC_CAP_DR1,
- .long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version)"),
+ .long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version)"),
};
/* flash version, not flipped upside-down, with alpha channel */
AVCodec ff_vp6a_decoder = {
.name = "vp6a",
.type = AVMEDIA_TYPE_VIDEO,
- .id = CODEC_ID_VP6A,
+ .id = AV_CODEC_ID_VP6A,
.priv_data_size = sizeof(VP56Context),
.init = vp6_decode_init,
.close = vp6_decode_free,
.decode = ff_vp56_decode_frame,
.capabilities = CODEC_CAP_DR1,
- .long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version, with alpha channel)"),
+ .long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version, with alpha channel)"),
};