зеркало из https://github.com/mozilla/gecko-dev.git
Bug 52275 - crasher if we ended up in DrawComposited() with a zero
width or height. r=pavlov,scc a=buster
This commit is contained in:
Родитель
cd4a57e441
Коммит
4610b59131
|
@ -671,6 +671,9 @@ nsImageGTK::DrawComposited(nsIRenderingContext &aContext,
|
|||
PRInt32 aX, PRInt32 aY,
|
||||
PRInt32 aWidth, PRInt32 aHeight)
|
||||
{
|
||||
if ((aWidth==0) || (aHeight==0))
|
||||
return;
|
||||
|
||||
nsDrawingSurfaceGTK* drawing = (nsDrawingSurfaceGTK*) aSurface;
|
||||
GdkVisual *visual = gdk_rgb_get_visual();
|
||||
|
||||
|
@ -717,6 +720,11 @@ nsImageGTK::DrawComposited(nsIRenderingContext &aContext,
|
|||
XImage *ximage = XGetImage(dpy, drawable,
|
||||
readX, readY, readWidth, readHeight,
|
||||
AllPlanes, ZPixmap);
|
||||
|
||||
NS_ASSERTION((ximage!=NULL), "XGetImage() failed");
|
||||
if (!ximage)
|
||||
return;
|
||||
|
||||
unsigned char *readData = new unsigned char[3*readWidth*readHeight];
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче