summaryrefslogtreecommitdiffstats
path: root/libavfilter/vsrc_gfxcapture_winrt.cpp
diff options
context:
space:
mode:
authorTimo Rothenpieler <[email protected]>2025-09-14 20:46:29 +0200
committerTimo Rothenpieler <[email protected]>2025-09-14 20:46:29 +0200
commit570949822b0fdfee96b055a8d4cce345a5334203 (patch)
treee9f01d66d0ce75ac2313017427074784bbce35ec /libavfilter/vsrc_gfxcapture_winrt.cpp
parentd74d3080ffdd358c595cf363f4053860d8fbb17d (diff)
avfilter/vsrc_gfxcapture: MapWindowPoints can return 0 and still succeed
Diffstat (limited to 'libavfilter/vsrc_gfxcapture_winrt.cpp')
-rw-r--r--libavfilter/vsrc_gfxcapture_winrt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vsrc_gfxcapture_winrt.cpp b/libavfilter/vsrc_gfxcapture_winrt.cpp
index 89cbdd3df9..49181f1c0e 100644
--- a/libavfilter/vsrc_gfxcapture_winrt.cpp
+++ b/libavfilter/vsrc_gfxcapture_winrt.cpp
@@ -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;
}