diff --git a/src/osgPlugins/png/ReaderWriterPNG.cpp b/src/osgPlugins/png/ReaderWriterPNG.cpp index a21e84169..ecf76b981 100644 --- a/src/osgPlugins/png/ReaderWriterPNG.cpp +++ b/src/osgPlugins/png/ReaderWriterPNG.cpp @@ -152,7 +152,7 @@ class ReaderWriterPNG : public osgDB::ReaderWriter png_read_end(png, endinfo); GLenum pixelFormat = 0; - GLenum dataType = depth==8?GL_UNSIGNED_BYTE:GL_UNSIGNED_SHORT; + GLenum dataType = depth<=8?GL_UNSIGNED_BYTE:GL_UNSIGNED_SHORT; switch(color) { case(PNG_SOLID): pixelFormat = GL_LUMINANCE; break;