Unified · Split
| @@ -45,6 +45,8 @@ static unsigned char *preload(FILE *file, int *data_size) · 44 unmodified lines | |||
| 45 | return 0; | 45 | return 0; |
| 46 | fseek(file, 0, SEEK_END); | 46 | fseek(file, 0, SEEK_END); |
| 47 | *data_size = (int)ftell(file); | 47 | *data_size = (int)ftell(file); |
| 48 | if (*data_size < 0) | ||
| 49 | return 0; | ||
| 48 | fseek(file, 0, SEEK_SET); | 50 | fseek(file, 0, SEEK_SET); |
| 49 | data = (unsigned char*)malloc(*data_size); | 51 | data = (unsigned char*)malloc(*data_size); |
| 50 | if (!data) | 52 | if (!data) |