From 56d1ab5f7a6fe51a15be86f80d027e941f3355fa Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Mon, 13 Jul 2015 06:26:15 +0000 Subject: [PATCH] snd_mp3.c: return type tweak for mp3_tagsize() git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1235 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/snd_mp3.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Quake/snd_mp3.c b/Quake/snd_mp3.c index 8a5348c6..1b9be3b3 100644 --- a/Quake/snd_mp3.c +++ b/Quake/snd_mp3.c @@ -8,7 +8,7 @@ * functions were adapted from the GPL-licensed libid3tag library, see at * http://www.underbit.com/products/mad/. Adapted to Quake and Hexen II * game engines by O.Sezer : - * Copyright (C) 2010-2013 O.Sezer + * Copyright (C) 2010-2015 O.Sezer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -89,16 +89,16 @@ static inline qboolean tag_is_id3v2(const unsigned char *data, size_t length) return false; } -static int mp3_tagsize(const unsigned char *data, size_t length) +static size_t mp3_tagsize(const unsigned char *data, size_t length) { + size_t size; + if (tag_is_id3v1(data, length)) return 128; if (tag_is_id3v2(data, length)) { - unsigned char flags; - unsigned int size; - flags = data[5]; + unsigned char flags = data[5]; size = 10 + (data[6]<<21) + (data[7]<<14) + (data[8]<<7) + data[9]; if (flags & ID3_TAG_FLAG_FOOTERPRESENT) size += 10;