Permalink
Browse files

Don't crash on empty images.

In ROOFTOPS.DAT for example.
  • Loading branch information...
NagyD committed Sep 17, 2017
1 parent d24cc30 commit 010c4b0a2bc243407aa5c9b7c023b225b8f582ed
Showing with 5 additions and 1 deletion.
  1. +3 −1 src/lib/object/image/image16.c
  2. +2 −0 src/lib/object/image/image256.c
@@ -158,7 +158,9 @@ int mExpandGraphic(const unsigned char* data,tImage *image, int dataSizeInBytes)
int imageSizeInBytes=0;
int result;
if (dataSizeInBytes < 6) return COMPRESS_RESULT_FATAL; // Empty images are only 2 bytes: 00 00.
image->height=array2short(data);
data+=2;
image->width =array2short(data);
@@ -120,6 +120,8 @@ int mExpandGraphic256(const unsigned char* data,tImage *image, int dataSizeInByt
int imageSizeInBytes=0;
if (dataSizeInBytes < 6) return COMPRESS_RESULT_FATAL; // Empty images are only 2 bytes: 00 00.
image->height=array2short(data);
data+=2;
image->width =array2short(data);

0 comments on commit 010c4b0

Please sign in to comment.