Commit 7102ed80 authored by Max Kellermann's avatar Max Kellermann

decoder/ogg_codec: return UNKNOWN on error

parent ebf481e1
...@@ -33,7 +33,7 @@ ogg_codec_detect(struct decoder *decoder, struct input_stream *is) ...@@ -33,7 +33,7 @@ ogg_codec_detect(struct decoder *decoder, struct input_stream *is)
unsigned char buf[41]; unsigned char buf[41];
size_t r = decoder_read(decoder, is, buf, sizeof(buf)); size_t r = decoder_read(decoder, is, buf, sizeof(buf));
if (r < sizeof(buf) || memcmp(buf, "OggS", 4) != 0) if (r < sizeof(buf) || memcmp(buf, "OggS", 4) != 0)
return OGG_CODEC_VORBIS; return OGG_CODEC_UNKNOWN;
if ((memcmp(buf + 29, "FLAC", 4) == 0 && if ((memcmp(buf + 29, "FLAC", 4) == 0 &&
memcmp(buf + 37, "fLaC", 4) == 0) || memcmp(buf + 37, "fLaC", 4) == 0) ||
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "decoder_api.h" #include "decoder_api.h"
enum ogg_codec { enum ogg_codec {
OGG_CODEC_UNKNOWN,
OGG_CODEC_VORBIS, OGG_CODEC_VORBIS,
OGG_CODEC_FLAC, OGG_CODEC_FLAC,
}; };
......
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