Skip to content

Commit

Permalink
TSA: don't crash when png_image_resize resizes to a smaller size
Browse files Browse the repository at this point in the history
  • Loading branch information
32th-System committed Jul 8, 2024
1 parent ae6aaff commit 9747dc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion thcrap_tsa/src/png_ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ int png_image_resize(
new_buf = (png_bytep)realloc(image.buf, new_size);
if(new_buf) {
image.buf = new_buf;
ZeroMemory(image.buf + prev_size, new_size - prev_size);
if(new_size > prev_size)
ZeroMemory(image.buf + prev_size, new_size - prev_size);

// If the width has changed, we need to move all rows
// in the image, going from bottom to top.
Expand Down

0 comments on commit 9747dc9

Please sign in to comment.