/* check if picture layout was changed and reallocate buffers */
if (ivi_pic_config_cmp(&pic_conf, &ctx->pic_conf)) {
- if (ff_ivi_init_planes(ctx->planes, &pic_conf, 1)) {
+ if (ff_ivi_init_planes(avctx, ctx->planes, &pic_conf, 1)) {
av_log(avctx, AV_LOG_ERROR, "Couldn't reallocate color planes!\n");
ctx->pic_conf.luma_bands = 0;
return AVERROR(ENOMEM);
/* skip picture header extension if any */
while (get_bits1(&ctx->gb)) {
ff_dlog(avctx, "Pic hdr extension encountered!\n");
+ if (get_bits_left(&ctx->gb) < 10)
+ return AVERROR_INVALIDDATA;
skip_bits(&ctx->gb, 8);
}