From b1aec91912043da574719dd5ee69fab63ff67f9f Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Thu, 14 Apr 2022 21:23:23 +0200 Subject: [PATCH] Assert that row size is not null Silences some static analysis warning --- src/gfx/process.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gfx/process.cpp b/src/gfx/process.cpp index 6c867880..b40c04a3 100644 --- a/src/gfx/process.cpp +++ b/src/gfx/process.cpp @@ -308,7 +308,9 @@ public: // Now that metadata has been read, we can process the image data - std::vector row(png_get_rowbytes(png, info)); + size_t nbRowBytes = png_get_rowbytes(png, info); + assert(nbRowBytes != 0); + std::vector row(nbRowBytes); if (interlaceType == PNG_INTERLACE_NONE) { for (png_uint_32 y = 0; y < height; ++y) {