From d5a1e4f93f0fc5d173a62b5e69d8cb519c39b993 Mon Sep 17 00:00:00 2001 From: Leonetienne Date: Sun, 6 Mar 2022 17:08:15 +0100 Subject: [PATCH] Fixed terrible bug in writer method --- Src/BmpWriter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Src/BmpWriter.cpp b/Src/BmpWriter.cpp index 53ae35c..71d4746 100644 --- a/Src/BmpWriter.cpp +++ b/Src/BmpWriter.cpp @@ -86,11 +86,12 @@ namespace Leonetienne::BmpPP { break; } - // Add row padding - // Since we have to pad to a multiple of 4, the padding will never be more than four bytes - for (std::size_t i = 0; i < paddingBytesPerRow; i++) - packedPixels.insert(packedPixels.cend(), 0x0); } + + // Add row padding + // Since we have to pad to a multiple of 4, the padding will never be more than four bytes + for (std::size_t i = 0; i < paddingBytesPerRow; i++) + packedPixels.insert(packedPixels.cend(), 0x0); } // Now we can finally set the fileSize field in the file header,