- /* Resize deflate buffer and frame on resolution change */
- if (ctx->inflated_size != avctx->width * avctx->height * 3) {
- av_frame_unref(ctx->current);
- ret = ff_get_buffer(avctx, ctx->current, AV_GET_BUFFER_FLAG_REF);
- if (ret < 0)
- return ret;
-
- /* If malloc fails, reset len to avoid preserving an invalid value */
- ctx->inflated_size = avctx->width * avctx->height * 3;
- ret = av_reallocp(&ctx->inflated_buf, ctx->inflated_size);
- if (ret < 0) {
- ctx->inflated_size = 0;
- return ret;
- }
- }
-