Bug 1426377 - Assert when aImageDataSize is bigger than allocated pool size, r?jhorak draft
authorMartin Stransky <stransky@redhat.com>
Wed, 20 Dec 2017 15:47:08 +0100
changeset 713528 787fb806462c9adedb976d61879ffe882a698adf
parent 713183 2d580aeac901ce5c61a4e5445b46906ce3cf33d8
child 744353 bf4fca1cc7d10119bb85d22bd2dced1bacd3bb82
push id93663
push userstransky@redhat.com
push dateWed, 20 Dec 2017 14:47:29 +0000
reviewersjhorak
bugs1426377
milestone59.0a1
Bug 1426377 - Assert when aImageDataSize is bigger than allocated pool size, r?jhorak MozReview-Commit-ID: DSMb5W2bGd0
widget/gtk/WindowSurfaceWayland.cpp
--- a/widget/gtk/WindowSurfaceWayland.cpp
+++ b/widget/gtk/WindowSurfaceWayland.cpp
@@ -418,17 +418,17 @@ WaylandShmPool::Resize(int aSize)
   mAllocatedSize = aSize;
   return true;
 }
 
 void
 WaylandShmPool::SetImageDataFromPool(class WaylandShmPool* aSourcePool,
                                      int aImageDataSize)
 {
-  MOZ_ASSERT(mAllocatedSize <= aImageDataSize, "WaylandShmPool overflows!");
+  MOZ_ASSERT(mAllocatedSize >= aImageDataSize, "WaylandShmPool overflows!");
   memcpy(mImageData, aSourcePool->GetImageData(), aImageDataSize);
 }
 
 WaylandShmPool::~WaylandShmPool()
 {
   munmap(mImageData, mAllocatedSize);
   wl_shm_pool_destroy(mShmPool);
   close(mShmPoolFd);