mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 964976 - Prevent crash of unsupported pixel format gralloc allocation. r=nical
This commit is contained in:
parent
5f37657f54
commit
38e9a6c028
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user