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