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
This commit is contained in:
Carsten Haitzler 2017-07-28 20:30:43 +09:00
parent 51cc2e0ec6
commit 02a07caca4
1 changed files with 2 additions and 2 deletions

View File

@ -315,7 +315,7 @@ _convert_etc2_rgb8_to_argb8888(void *dst, const void *src, int w, int h,
{
rg_etc2_rgb8_decode_block(in, bgra);
for (k = 0; k < 4; k++)
memcpy(out + x + k * out_step, bgra + k * 16, 16);
memcpy(out + x + k * out_step, bgra + (k * 4), 16);
}
}
@ -347,7 +347,7 @@ _convert_etc2_rgba8_to_argb8888(void *dst, const void *src, int w, int h,
{
rg_etc2_rgba8_decode_block(in, bgra);
for (k = 0; k < 4; k++)
memcpy(out + x + k * out_step, bgra + k * 16, 16);
memcpy(out + x + k * out_step, bgra + (k * 4), 16);
}
out += out_step * 4;
}