mirror of
https://github.com/aap/librw.git
synced 2025-12-18 16:39:51 +00:00
Some fixes.
This commit is contained in:
5
src/image.cpp
Normal file → Executable file
5
src/image.cpp
Normal file → Executable file
@@ -75,7 +75,7 @@ Texture::read(const char *name, const char *mask)
|
||||
Raster *raster = NULL;
|
||||
Texture *tex;
|
||||
|
||||
if((tex = currentTexDictionary->find(name)))
|
||||
if(currentTexDictionary && (tex = currentTexDictionary->find(name)))
|
||||
return tex;
|
||||
tex = new Texture;
|
||||
strncpy(tex->name, name, 32);
|
||||
@@ -90,7 +90,8 @@ Texture::read(const char *name, const char *mask)
|
||||
delete img;
|
||||
}
|
||||
tex->raster = raster;
|
||||
currentTexDictionary->add(tex);
|
||||
if(currentTexDictionary)
|
||||
currentTexDictionary->add(tex);
|
||||
return tex;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user