ret = av_hwframe_get_buffer(ctx->internal->source_frames,
src_frame, 0);
- if (ret < 0)
+ if (ret < 0) {
+ av_frame_free(&src_frame);
return ret;
+ }
ret = av_hwframe_map(frame, src_frame,
ctx->internal->source_allocation_map_flags);
ret = AVERROR(ENOMEM);
goto fail;
}
+ ret = av_hwdevice_ctx_init(dst_ref);
+ if (ret < 0)
+ goto fail;
goto done;
}
if (ret != AVERROR(ENOSYS))
goto fail;
done:
- ret = av_hwdevice_ctx_init(dst_ref);
- if (ret < 0)
- goto fail;
-
*dst_ref_ptr = dst_ref;
return 0;