From 7102ed802638e31f8a8391b51a2989cd087748d1 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Tue, 4 Sep 2012 13:46:12 +0200
Subject: decoder/ogg_codec: return UNKNOWN on error

---
 src/decoder/ogg_codec.c | 2 +-
 src/decoder/ogg_codec.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/decoder')

diff --git a/src/decoder/ogg_codec.c b/src/decoder/ogg_codec.c
index 7d05db8e7..e016e5181 100644
--- a/src/decoder/ogg_codec.c
+++ b/src/decoder/ogg_codec.c
@@ -33,7 +33,7 @@ ogg_codec_detect(struct decoder *decoder, struct input_stream *is)
 	unsigned char buf[41];
 	size_t r = decoder_read(decoder, is, buf, sizeof(buf));
 	if (r < sizeof(buf) || memcmp(buf, "OggS", 4) != 0)
-		return OGG_CODEC_VORBIS;
+		return OGG_CODEC_UNKNOWN;
 
 	if ((memcmp(buf + 29, "FLAC", 4) == 0 &&
 	     memcmp(buf + 37, "fLaC", 4) == 0) ||
diff --git a/src/decoder/ogg_codec.h b/src/decoder/ogg_codec.h
index ac2cdc0ed..d99758cad 100644
--- a/src/decoder/ogg_codec.h
+++ b/src/decoder/ogg_codec.h
@@ -27,6 +27,7 @@
 #include "decoder_api.h"
 
 enum ogg_codec {
+	OGG_CODEC_UNKNOWN,
 	OGG_CODEC_VORBIS,
 	OGG_CODEC_FLAC,
 };
-- 
cgit v1.2.3