From df7b13499f8a0b95467326c2dc232117c6a3ceac Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 26 Mar 2024 02:15:07 -0700 Subject: [PATCH] YUV420pFrame::BufferRGBA: fix uninitialized width/height - This fixes a video recording crash that manifested randomly, but more often when repeatedly quickly starting and stopping a recording - The first video frame had uninitialized memory that left it up to chance whether an internal buffer was correctly sized (SIGSEGV) --- src/media/yuv420p.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/media/yuv420p.hpp b/src/media/yuv420p.hpp index 6ea5022bf..7ca9f6210 100644 --- a/src/media/yuv420p.hpp +++ b/src/media/yuv420p.hpp @@ -1,6 +1,6 @@ // RING RACERS //----------------------------------------------------------------------------- -// Copyright (C) 2023 by James Robert Roman +// Copyright (C) 2023-2024 by James Robert Roman // // This program is free software distributed under the // terms of the GNU General Public License, version 2. @@ -36,7 +36,8 @@ public: int height() const { return height_; } private: - int width_, height_; + int width_ = 0; + int height_ = 0; std::vector vec_; };