Fix crashing when accessing out of global arrays

This commit is contained in:
Pali Rohár committed 2013-01-05 12:11:03 +01:00
1 parent 9ea9bea096
commit e362f3cab9
3 files changed
+4 -5

No files matched your search

+1 -1
View File
@@ -540,7 +540,7 @@ enum image_type image_type_from_string(const char * type) {
const char * image_type_to_string(enum image_type type) {
if ( type > sizeof(image_types)/sizeof(image_types[0]) )
if ( type >= sizeof(image_types)/sizeof(image_types[0]) )
return NULL;
return image_types[type];