Skip to content

Commit

Permalink
formats: Do not try to read 0 bytes in sd_language_load()
Browse files Browse the repository at this point in the history
  • Loading branch information
mrannanj committed Dec 2, 2024
1 parent 04a57e0 commit 6add65e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/formats/language.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ int sd_language_load(sd_language *language, const char *filename) {
language->strings[i].data = omf_calloc(len + 1, 1);
memset(language->strings[i].data, 0, len + 1);

if(len == 0)
continue;

// Read string
memreader *mr = memreader_open_from_reader(r, len);
memreader_xor(mr, len & 0xFF);
Expand Down

0 comments on commit 6add65e

Please sign in to comment.