}
if (for_user) {
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
dst->coded_frame = src->coded_frame;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
} else {
if (dst->codec->update_thread_context)
err = dst->codec->update_thread_context(dst, src);
}
avctx->internal->thread_ctx = fctx = av_mallocz(sizeof(FrameThreadContext));
+ if (!fctx)
+ return AVERROR(ENOMEM);
fctx->threads = av_mallocz(sizeof(PerThreadContext) * thread_count);
+ if (!fctx->threads) {
+ av_freep(&avctx->internal->thread_ctx);
+ return AVERROR(ENOMEM);
+ }
+
pthread_mutex_init(&fctx->buffer_mutex, NULL);
fctx->delaying = 1;