From ce53c5cc70361341a7cc0f98ef07440de39c039a Mon Sep 17 00:00:00 2001 From: sorayuki Date: Tue, 7 Aug 2018 17:15:07 +0800 Subject: [PATCH] win-capture: Avoid tex size mismatch for cursor Re-fetch texture when cursor's either width or height changed. When the cursor icon changed and the new one has the same width or height, it may not recreate the texture and thus cause memory access violation. --- plugins/win-capture/cursor-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/win-capture/cursor-capture.c b/plugins/win-capture/cursor-capture.c index 1cf54e68f..a88aec786 100644 --- a/plugins/win-capture/cursor-capture.c +++ b/plugins/win-capture/cursor-capture.c @@ -166,7 +166,7 @@ static inline bool cursor_capture_icon(struct cursor_data *data, HICON icon) bitmap = cursor_capture_icon_bitmap(&ii, &width, &height); if (bitmap) { - if (data->last_cx != width && data->last_cy != height) { + if (data->last_cx != width || data->last_cy != height) { data->texture = get_cached_texture(data, width, height); data->last_cx = width; data->last_cy = height;