Permalink
Browse files

fix segfault from incorrect delete[] (#1237)

  • Loading branch information...
RobertBColton authored and RemoveRusky committed May 22, 2018
1 parent c516f8c commit f574a63563d2523ba46a0e782f17c16edd0a76be
Showing with 2 additions and 3 deletions.
  1. +2 −3 ENIGMAsystem/SHELL/Graphics_Systems/Direct3D9/DX9draw.cpp
@@ -128,7 +128,7 @@ int draw_getpixel(int x, int y)
unsigned offset = y * rect.Pitch + x * 4;
int ret = bitmap[offset + 2] | (bitmap[offset + 1] << 8) | (bitmap[offset + 0] << 16);
pDestBuffer->UnlockRect();
delete[] bitmap;

pBackBuffer->Release();
pDestBuffer->Release();

@@ -165,7 +165,7 @@ int draw_getpixel_ext(int x, int y)
unsigned offset = y * rect.Pitch + x * 4;
int ret = bitmap[offset + 2] | (bitmap[offset + 1] << 8) | (bitmap[offset + 0] << 16) | (bitmap[offset + 3] << 24);
pDestBuffer->UnlockRect();
delete[] bitmap;

pBackBuffer->Release();
pDestBuffer->Release();
return ret;
@@ -183,4 +183,3 @@ bool fill_complex_polygon(const std::list<PolyVertex>& vertices, int defaultColo
}

}

0 comments on commit f574a63

Please sign in to comment.