diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index 8ab7ee69f01..59348da94af 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -861,7 +861,7 @@ BufferTextureClient::AllocateForYCbCr(gfx::IntSize aYSize, size_t bufSize = YCbCrImageDataSerializer::ComputeMinBufferSize(aYSize, aCbCrSize); - if (!Allocate(bufSize)) { + if (!bufSize || !Allocate(bufSize)) { return false; } YCbCrImageDataSerializer serializer(GetBuffer(), GetBufferSize());