From 41487426f5fb19c963e5f94e8c4f791637e2da03 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 4 Sep 2012 11:22:15 +0200 Subject: decoder/_ogg_common: fix buffer size check Fixes potential access to uninitialised memory. --- src/decoder/_ogg_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/decoder') diff --git a/src/decoder/_ogg_common.c b/src/decoder/_ogg_common.c index 8df97eef8..09d2712da 100644 --- a/src/decoder/_ogg_common.c +++ b/src/decoder/_ogg_common.c @@ -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 && -- cgit v1.2.3