diff --git a/gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp b/gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp index 884d780bb148..73bbf11c52c5 100644 --- a/gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp +++ b/gfx/layers/ipc/ShadowLayerUtilsGralloc.cpp @@ -172,6 +172,9 @@ PixelFormatForImageFormat(gfxImageFormat aFormat) return android::PIXEL_FORMAT_RGBX_8888; case gfxImageFormat::RGB16_565: return android::PIXEL_FORMAT_RGB_565; + case gfxImageFormat::A8: + NS_WARNING("gralloc does not support gfxImageFormat::A8"); + return android::PIXEL_FORMAT_UNKNOWN; default: MOZ_CRASH("Unknown gralloc pixel format"); } @@ -430,6 +433,10 @@ ISurfaceAllocator::PlatformAllocSurfaceDescriptor(const gfx::IntSize& aSize, PGrallocBufferChild* gc; bool defaultRBSwap; + if (PixelFormatForContentType(aContent) == android::PIXEL_FORMAT_UNKNOWN) { + return false; + } + if (aCaps & USING_GL_RENDERING_ONLY) { gc = AllocGrallocBuffer(aSize, PixelFormatForContentType(aContent),