decoder/_ogg_common: fix buffer size check
Fixes potential access to uninitialised memory.
This commit is contained in:
parent
0d24250aa7
commit
41487426f5
@ -33,7 +33,7 @@ ogg_stream_type ogg_stream_type_detect(struct input_stream *inStream)
|
|||||||
size_t r;
|
size_t r;
|
||||||
|
|
||||||
r = decoder_read(NULL, inStream, buf, sizeof(buf));
|
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;
|
return VORBIS;
|
||||||
|
|
||||||
if ((memcmp(buf + 29, "FLAC", 4) == 0 &&
|
if ((memcmp(buf + 29, "FLAC", 4) == 0 &&
|
||||||
|
Loading…
Reference in New Issue
Block a user