projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e10387
)
added check to prevent crash when drawing sprites for undefined graphics
author
Holger Schemel
<info@artsoft.org>
Tue, 17 Apr 2018 17:49:13 +0000
(19:49 +0200)
committer
Holger Schemel
<info@artsoft.org>
Tue, 17 Apr 2018 17:49:13 +0000
(19:49 +0200)
Due to a bug (that will be fixed with the following commit) it may
be possible that game elements are drawn for undefined graphics ID,
resulting in a crash.
A check was added to prevent drawing sprites for undefined graphics.
src/game_sp/DDSpriteBuffer.c
patch
|
blob
|
history
diff --git
a/src/game_sp/DDSpriteBuffer.c
b/src/game_sp/DDSpriteBuffer.c
index 261459adbd04ee65f594eeee4448b4c5ded80412..e4be416487fe8259ee05cf3dce921be901028c6b 100644
(file)
--- a/
src/game_sp/DDSpriteBuffer.c
+++ b/
src/game_sp/DDSpriteBuffer.c
@@
-37,6
+37,9
@@
void DDSpriteBuffer_BltImg(int pX, int pY, int graphic, int sync_frame)
if (NoDisplayFlag)
return;
+ if (graphic < 0)
+ return;
+
getGraphicSource_SP(&g, graphic, sync_frame, -1, -1);
Blt(pX, pY, g.bitmap, g.src_x, g.src_y);