fix a crash when working on an 0x0 BitmapBuffer

This commit is contained in:
zeromus 2014-12-10 19:37:06 +00:00
parent f1bd6f0086
commit 257c8c597b
1 changed files with 13 additions and 10 deletions

View File

@ -476,6 +476,8 @@ namespace BizHawk.Bizware.BizwareGL
{
var bmpdata = bmp.LockBits(new sd.Rectangle(0, 0, Width, Height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
if (bmp.Width != 0 && bmp.Height != 0)
{
int* ptr = (int*)bmpdata.Scan0.ToPointer();
int stride = bmpdata.Stride;
fixed (int* pPtr = &Pixels[0])
@ -488,6 +490,7 @@ namespace BizHawk.Bizware.BizwareGL
idx++;
}
}
}
bmp.UnlockBits(bmpdata);
}