projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e803858
)
fixed crash bug caused by accessing invalid (off-playfield) array positions
author
Holger Schemel
<info@artsoft.org>
Tue, 8 Feb 2022 15:17:42 +0000
(16:17 +0100)
committer
Holger Schemel
<info@artsoft.org>
Tue, 8 Feb 2022 16:01:32 +0000
(17:01 +0100)
This bug caused accessing array "GfxElementEmpty[][]" out of bounds if
level position is not inside the playfield.
src/tools.c
patch
|
blob
|
history
diff --git
a/src/tools.c
b/src/tools.c
index 0872e24bc1fde98a5459eff7dda8fff43ae68293..6a998afb360639bb7611ac472c06ff6b0c7bf497 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-1996,11
+1996,11
@@
void DrawScreenElementExt(int x, int y, int dx, int dy, int element,
int graphic;
int frame;
- if (element == EL_EMPTY)
- element = GfxElementEmpty[lx][ly];
-
if (IN_LEV_FIELD(lx, ly))
{
+ if (element == EL_EMPTY)
+ element = GfxElementEmpty[lx][ly];
+
SetRandomAnimationValue(lx, ly);
graphic = el_act_dir2img(element, GfxAction[lx][ly], GfxDir[lx][ly]);