av_freep(&band->tiles);
band->tiles = av_mallocz_array(band->num_tiles, sizeof(IVITile));
- if (!band->tiles)
+ if (!band->tiles) {
+ band->num_tiles = 0;
return AVERROR(ENOMEM);
+ }
/* use the first luma band as reference for motion vectors
* and quant */
AVPacket pkt;
pkt.data = avpkt->data + (get_bits_count(&ctx->gb) >> 3);
pkt.size = get_bits_left(&ctx->gb) >> 3;
+ ctx->got_p_frame = 0;
+ av_frame_unref(ctx->p_frame);
ff_ivi_decode_frame(avctx, ctx->p_frame, &ctx->got_p_frame, &pkt);
}
}