From 476c1f89a237871571471edbf38d7b6fbb590b33 Mon Sep 17 00:00:00 2001 From: Sean Barrett Date: Thu, 7 Feb 2019 07:01:23 -0800 Subject: [PATCH] stb_image_write: fix the previous fix (incorrectly labelled as stb_image) --- stb_image_write.h | 2 +- tests/image_test.dsp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/stb_image_write.h b/stb_image_write.h index c2a9a7f..c6bd5e2 100644 --- a/stb_image_write.h +++ b/stb_image_write.h @@ -1469,6 +1469,7 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in for(x = 0; x < width; x += 8) { float YDU[64], UDU[64], VDU[64]; for(row = y, pos = 0; row < y+8; ++row) { + int p; if(row < height) { p = (stbi__flip_vertically_on_write ? (height-1-row) : row)*width*comp; } else { @@ -1477,7 +1478,6 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in } for(col = x; col < x+8; ++col, ++pos) { float r, g, b; - int p; // if col >= width => use pixel from last input column p += ((col < width) ? col : (width-1))*comp; diff --git a/tests/image_test.dsp b/tests/image_test.dsp index 840ea16..4efd647 100644 --- a/tests/image_test.dsp +++ b/tests/image_test.dsp @@ -41,7 +41,8 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe