summaryrefslogtreecommitdiff
path: root/src/static_libs
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-28 20:30:43 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-29 09:08:40 +0900
commit02a07caca4c33c76c8174d6bc8e2edbd9e8c4a0d (patch)
tree21e83e66406332e926d749131a67fd6d3029d104 /src/static_libs
parent51cc2e0ec6939f696cc09a766c4742f4bb1baa14 (diff)
etc to rgba conversion - dont read stack garbage into the est imgs
surprising this wasn't caught when testing fallbacks. etc2 is used hyper-rarely but still... basically it'd skip pixels and read stack junk (which really would not crash but we'd have junk in image data). or should. found by PVS studio @fix
Diffstat (limited to 'src/static_libs')
-rw-r--r--src/static_libs/draw/draw_convert.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/static_libs/draw/draw_convert.c b/src/static_libs/draw/draw_convert.c
index 1c65f4d..81c727f 100644
--- a/src/static_libs/draw/draw_convert.c
+++ b/src/static_libs/draw/draw_convert.c
@@ -315,7 +315,7 @@ _convert_etc2_rgb8_to_argb8888(void *dst, const void *src, int w, int h,
315 { 315 {
316 rg_etc2_rgb8_decode_block(in, bgra); 316 rg_etc2_rgb8_decode_block(in, bgra);
317 for (k = 0; k < 4; k++) 317 for (k = 0; k < 4; k++)
318 memcpy(out + x + k * out_step, bgra + k * 16, 16); 318 memcpy(out + x + k * out_step, bgra + (k * 4), 16);
319 } 319 }
320 } 320 }
321 321
@@ -347,7 +347,7 @@ _convert_etc2_rgba8_to_argb8888(void *dst, const void *src, int w, int h,
347 { 347 {
348 rg_etc2_rgba8_decode_block(in, bgra); 348 rg_etc2_rgba8_decode_block(in, bgra);
349 for (k = 0; k < 4; k++) 349 for (k = 0; k < 4; k++)
350 memcpy(out + x + k * out_step, bgra + k * 16, 16); 350 memcpy(out + x + k * out_step, bgra + (k * 4), 16);
351 } 351 }
352 out += out_step * 4; 352 out += out_step * 4;
353 } 353 }