decoder/_ogg_common: fix buffer size check

Fixes potential access to uninitialised memory.
This commit is contained in:
Max Kellermann 2012-09-04 11:22:15 +02:00
parent 0d24250aa7
commit 41487426f5

View File

@ -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 &&