From 3d6bec6d2d6415d1a7279318c42d79414d97ee78 Mon Sep 17 00:00:00 2001 From: jpark37 Date: Sat, 9 May 2020 09:12:48 -0700 Subject: [PATCH] mac-capture: Use resize instead of reserve Better practice for the tracked size to be nonzero. This does NOT speed up window capture significantly. --- plugins/mac-capture/mac-window-capture.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mac-capture/mac-window-capture.m b/plugins/mac-capture/mac-window-capture.m index bca28901f..17c0c283e 100644 --- a/plugins/mac-capture/mac-window-capture.m +++ b/plugins/mac-capture/mac-window-capture.m @@ -51,7 +51,7 @@ static inline void capture_frame(struct window_capture *wc) size_t height = CGImageGetHeight(img); CGRect rect = {{0, 0}, {width, height}}; - da_reserve(wc->buffer, width * height * 4); + da_resize(wc->buffer, width * height * 4); uint8_t *data = wc->buffer.array; CGContextRef cg_context = CGBitmapContextCreate(