avfilter/vsrc_gfxcapture: MapWindowPoints can return 0 and still succeed

This commit is contained in:
Timo Rothenpieler
2025-09-14 20:46:29 +02:00
parent d74d3080ff
commit 570949822b

View File

@@ -264,7 +264,8 @@ static int wgc_calculate_client_area(AVFilterContext *avctx)
return AVERROR_EXTERNAL;
}
if (!MapWindowPoints(ctx->capture_hwnd, nullptr, (POINT*)&client_rect, 2)) {
SetLastError(0);
if (!MapWindowPoints(ctx->capture_hwnd, nullptr, (POINT*)&client_rect, 2) && GetLastError()) {
av_log(avctx, AV_LOG_ERROR, "MapWindowPoints failed\n");
return AVERROR_EXTERNAL;
}