mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
Account for offsets when creating buffers for image textures.
This commit is contained in:
parent
36c694e627
commit
14c6f518ce
4 changed files with 45 additions and 4 deletions
|
|
@ -259,7 +259,9 @@ CreateBackendIndependentTextureHost(const SurfaceDescriptor& aDesc,
|
|||
case BufferDescriptor::TYCbCrDescriptor: {
|
||||
const YCbCrDescriptor& ycbcr = desc.get_YCbCrDescriptor();
|
||||
reqSize =
|
||||
ImageDataSerializer::ComputeYCbCrBufferSize(ycbcr.ySize(), ycbcr.cbCrSize());
|
||||
ImageDataSerializer::ComputeYCbCrBufferSize(ycbcr.ySize(), ycbcr.cbCrSize(),
|
||||
ycbcr.yOffset(), ycbcr.cbOffset(),
|
||||
ycbcr.crOffset());
|
||||
break;
|
||||
}
|
||||
case BufferDescriptor::TRGBDescriptor: {
|
||||
|
|
@ -272,7 +274,7 @@ CreateBackendIndependentTextureHost(const SurfaceDescriptor& aDesc,
|
|||
MOZ_CRASH("GFX: Bad descriptor");
|
||||
}
|
||||
|
||||
if (bufSize < reqSize) {
|
||||
if (reqSize == 0 || bufSize < reqSize) {
|
||||
NS_ERROR("A client process gave a shmem too small to fit for its descriptor!");
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue