1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-26 06:28:30 +02:00

Add length check to OGG check

Dav999 pointed out this potential issue on Discord.

While basically all memcmp implementations will terminate early here if
there's a null byte (because it's mismatched), it doesn't hurt to add
the check here.
This commit is contained in:
Misa 2023-03-19 14:00:34 -07:00
parent 2dc7f0b5e8
commit 397d7f21b4

View File

@ -107,7 +107,7 @@ public:
}
SDL_zerop(this);
if (SDL_memcmp(mem, "OggS", 4) == 0)
if (length >= 4 && SDL_memcmp(mem, "OggS", 4) == 0)
{
LoadOGG(fileName, mem, length);
}