Skip to content

Commit df2b196

Browse files
committed
Fix compiler error by ensuring a variable is always initialized.
1 parent c164515 commit df2b196

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/etc1tool/etc1tool.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ int read_PNG_File(const char* pInput, etc1_byte** ppImageData,
142142
png_bytep* row_pointers = NULL; // Does not need to be deallocated.
143143
png_uint_32 width = 0;
144144
png_uint_32 height = 0;
145+
png_uint_32 stride = 0;
145146
int result = -1;
146147
etc1_byte* pSourceImage = 0;
147148

@@ -196,7 +197,7 @@ int read_PNG_File(const char* pInput, etc1_byte** ppImageData,
196197
&color_type, NULL, NULL, NULL);
197198
}
198199

199-
png_uint_32 stride = 3 * width;
200+
stride = 3 * width;
200201

201202
pSourceImage = new etc1_byte[stride * height];
202203
if (! pSourceImage) {

0 commit comments

Comments
 (0)