diff options
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index b868d6a51f..716989e0c8 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -219,12 +219,14 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { GrGLint numFormats; GR_GL_GetIntegerv(gli, GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numFormats); - SkAutoSTMalloc<10, GrGLint> formats(numFormats); - GR_GL_GetIntegerv(gli, GR_GL_COMPRESSED_TEXTURE_FORMATS, formats); - for (int i = 0; i < numFormats; ++i) { - if (formats[i] == GR_GL_PALETTE8_RGBA8) { - f8BitPaletteSupport = true; - break; + if (numFormats) { + SkAutoSTMalloc<10, GrGLint> formats(numFormats); + GR_GL_GetIntegerv(gli, GR_GL_COMPRESSED_TEXTURE_FORMATS, formats); + for (int i = 0; i < numFormats; ++i) { + if (formats[i] == GR_GL_PALETTE8_RGBA8) { + f8BitPaletteSupport = true; + break; + } } } |