texturec: Fixed crash when converting 16bpp single channel PNG.

This commit is contained in:
Branimir Karadžić 2016-09-27 18:12:22 -07:00
Родитель 84e4a66c96
Коммит d1e51b118a
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -153,7 +153,7 @@ namespace bgfx
case LCT_GREY:
for (uint32_t ii = 0, num = width*height; ii < num; ++ii)
{
uint16_t* rgba = (uint16_t*)out + ii*4;
uint16_t* rgba = (uint16_t*)out + ii;
rgba[0] = bx::toHostEndian(rgba[0], false);
}
format = bgfx::TextureFormat::R16;
@ -163,12 +163,12 @@ namespace bgfx
case LCT_GREY_ALPHA:
for (uint32_t ii = 0, num = width*height; ii < num; ++ii)
{
uint16_t* rgba = (uint16_t*)out + ii*4;
uint16_t* rgba = (uint16_t*)out + ii*2;
rgba[0] = bx::toHostEndian(rgba[0], false);
rgba[1] = bx::toHostEndian(rgba[1], false);
}
format = bgfx::TextureFormat::R16;
bpp = 16;
format = bgfx::TextureFormat::RG16;
bpp = 32;
break;
case LCT_RGBA: