[tracker/meegotouch-guess-charset] tracker-extract, mp3: Add comment and fix size param of get_encoding
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/meegotouch-guess-charset] tracker-extract, mp3: Add comment and fix size param of get_encoding
- Date: Fri, 4 Mar 2011 13:09:40 +0000 (UTC)
commit 2eae0dc81e56bfe9ec59e53a27b8dd30797bd788
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Mar 4 14:09:04 2011 +0100
tracker-extract,mp3: Add comment and fix size param of get_encoding
src/tracker-extract/tracker-extract-mp3.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index 93ccc4d..0c56894 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -740,13 +740,14 @@ get_id3 (const gchar *data,
gboolean encoding_was_found;
/* Get the encoding for ALL the data we are extracting here */
-
+ /* This wont work with encodings where a NUL byte may be actually valid,
+ * like UTF-16 */
s = g_string_new_len (pos, strnlen (pos, 30));
g_string_append_len (s, pos + 30, strnlen (pos+30, 30));
g_string_append_len (s, pos + 60, strnlen (pos+60, 30));
g_string_append_len (s, pos + 94, strnlen (pos+94, ((pos+94)[28] != 0) ? 30 : 28));
- encoding = get_encoding (s->str, 90, &encoding_was_found);
+ encoding = get_encoding (s->str, s->len, &encoding_was_found);
if (encoding_was_found) {
id3->encoding = g_strdup (encoding);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]