git » fp-git.git » commit 273c7e3

vg-bugfix: uninitialized values where used in offsets

author ecalot
2004-08-27 19:40:33 UTC
committer ecalot
2004-08-27 19:40:33 UTC
parent c7ac7554d87a4717e1b4cdf986c8f460b89d6dee

vg-bugfix: uninitialized values where used in offsets

FP/src/res/resources.c +5 -2

diff --git a/FP/src/res/resources.c b/FP/src/res/resources.c
index 7f4fa2a..c5a9090 100644
--- a/FP/src/res/resources.c
+++ b/FP/src/res/resources.c
@@ -218,8 +218,11 @@ tData* resLoad(long id) {
 				}
 
 				/* get the offsets to move the image */
-				if (pal.colors==16) /* available only for 16 colors images */
-				getOffsets(&down,&left,&right,from+2,has_D,has_L,has_R,result->frames,total);
+				if (pal.colors==16) {/* available only for 16 colors images */
+					getOffsets(&down,&left,&right,from+2,has_D,has_L,has_R,result->frames,total);
+				} else {
+					down=left=right=0;
+				}
 				
 				/* expand raw image into an image structure */
 				mExpandGraphic(raw.array,&image,raw.size);