avutil/hwcontext_drm: fix mapping when dst format is unset

av_hwframe_map() is documented to work with a blank dst frame, but
hwcontext_drm currently fails if dst->format == AV_PIX_FMT_NONE.

Signed-off-by: Cameron Gutman <aicommander@gmail.com>
This commit is contained in:
Cameron Gutman committed 2025-09-03 20:21:51 -05:00
1 parent 858aa6176b
commit 37f02603b1
1 file changed
+3 -1
+3 -1
View File
@@ -288,7 +288,9 @@ static int drm_map_from(AVHWFramesContext *hwfc, AVFrame *dst,
{
int err;
if (hwfc->sw_format != dst->format)
if (dst->format == AV_PIX_FMT_NONE)
dst->format = hwfc->sw_format;
else if (hwfc->sw_format != dst->format)
return AVERROR(ENOSYS);
err = drm_map_frame(hwfc, dst, src, flags);