Bugzilla – Bug 573
Incorrect usage dstImage in _ktxUnpackETC leads to AV
Last modified: 2012-01-17 19:18:59 PST
Created attachment 92 [details] Patch for etcunpack.c to fix this bug In function _ktxUnpackETC (etcunpack.c) there is: ... newimg[ (yy*active_width)*3 + xx*3 + 0 ] = *dstImage[ (yy*width)*3 + xx*3 + 0]; newimg[ (yy*active_width)*3 + xx*3 + 1 ] = *dstImage[ (yy*width)*3 + xx*3 + 1]; newimg[ (yy*active_width)*3 + xx*3 + 2 ] = *dstImage[ (yy*width)*3 + xx*3 + 2]; ... but it must be of course like this: ... newimg[ (yy*active_width)*3 + xx*3 + 0 ] = (*dstImage)[ (yy*width)*3 + xx*3 + 0]; newimg[ (yy*active_width)*3 + xx*3 + 1 ] = (*dstImage)[ (yy*width)*3 + xx*3 + 1]; newimg[ (yy*active_width)*3 + xx*3 + 2 ] = (*dstImage)[ (yy*width)*3 + xx*3 + 2]; ... Without this (typo?) fix you get an AV or "garbage" image. PS. This code also is not optimized, but case when this code would be executed is really rare/low.
In SVN r16605.