- av_log(avctx, AV_LOG_ERROR, "Could not reset inflate: %d\n", zret);
- return AVERROR(EINVAL);
+ av_log(avctx, AV_LOG_ERROR, "Could not reset inflate: %d.\n", zret);
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (avctx->get_buffer(avctx, pic) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
+ return AVERROR(ENOMEM);