Commit 41487426 authored by Max Kellermann's avatar Max Kellermann

decoder/_ogg_common: fix buffer size check

Fixes potential access to uninitialised memory.
parent 0d24250a
......@@ -33,7 +33,7 @@ ogg_stream_type ogg_stream_type_detect(struct input_stream *inStream)
size_t r;
r = decoder_read(NULL, inStream, buf, sizeof(buf));
if (r < 32 || memcmp(buf, "OggS", 4) != 0)
if (r < sizeof(buf) || memcmp(buf, "OggS", 4) != 0)
return VORBIS;
if ((memcmp(buf + 29, "FLAC", 4) == 0 &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment