Skip to content

Commit

Permalink
fix segfault from incorrect delete[] (#1237)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBColton authored and RemoveRusky committed May 22, 2018
1 parent c516f8c commit f574a63
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ENIGMAsystem/SHELL/Graphics_Systems/Direct3D9/DX9draw.cpp
Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand All @@ -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.