Permalink
Browse files

Merge pull request #7346 from JosJuice/png-buffer-overflow

Fix critital buffer overflow in LoadPNG
  • Loading branch information...
delroth committed Aug 19, 2018
2 parents 8f847c7 + be890c5 commit 5eca5f69c5e15625c99eb4d95d11761756bb1de1
Showing with 1 addition and 1 deletion.
  1. +1 −1 Source/Core/Common/Image.cpp
@@ -24,11 +24,11 @@ bool LoadPNG(const std::vector<u8>& input, std::vector<u8>* data_out, u32* width
return false;
// Prepare output vector
png.format = PNG_FORMAT_RGBA;
size_t png_size = PNG_IMAGE_SIZE(png);
data_out->resize(png_size);
// Convert to RGBA and write into output vector
png.format = PNG_FORMAT_RGBA;
if (!png_image_finish_read(&png, nullptr, data_out->data(), 0, nullptr))
return false;

0 comments on commit 5eca5f6

Please sign in to comment.