Commit b757bb184a for ffmpeg
commit b757bb184a4699ec0c50279b0b40f1270fc3b242
Author: Julius Bairaktaris <julius@bairaktaris.de>
Date: Mon Sep 28 11:22:38 2026 +0200
avutil/hwcontext_amf: do not map to system memory for a hardware target
amf_map_frame() ignores dst->format and always maps to system memory.
hwmap to a hardware format therefore passes a system memory frame down a
hardware link, and the next filter fails. Return AVERROR(ENOSYS) for a
hardware destination format. Mapping to system memory is unchanged.
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
diff --git a/libavutil/hwcontext_amf.c b/libavutil/hwcontext_amf.c
index 7709614ebd..994411383b 100644
--- a/libavutil/hwcontext_amf.c
+++ b/libavutil/hwcontext_amf.c
@@ -1097,6 +1097,10 @@ static int amf_map_frame(AVHWFramesContext *device_ctx, AVFrame *dst, const AVFr
size_t plane_count = 0;
int ret = -1;
+ if (dst->format != AV_PIX_FMT_NONE &&
+ av_pix_fmt_desc_get(dst->format)->flags & AV_PIX_FMT_FLAG_HWACCEL)
+ return AVERROR(ENOSYS);
+
AMF_RETURN_IF_FALSE(device_ctx, surface != NULL, AVERROR(EINVAL) , "Source surface is null");
res = AMF_IFACE_CALL(surface, QueryInterface, &guid, (void**)&surface1);