[xiph-commits] r3345 - libfishsound/branches/1.0-stable/src/libfishsound

conrad at svn.annodex.net conrad at svn.annodex.net
Fri Jan 11 20:04:11 PST 2008


Author: conrad
Date: 2008-01-11 20:04:10 -0800 (Fri, 11 Jan 2008)
New Revision: 3345

Modified:
   libfishsound/branches/1.0-stable/src/libfishsound/comments.c
Log:
handle malformed but common vorbiscomments where name=value pairs are
separated by '\0' instead of '='. (Is this an oggenc bug? ...)


Modified: libfishsound/branches/1.0-stable/src/libfishsound/comments.c
===================================================================
--- libfishsound/branches/1.0-stable/src/libfishsound/comments.c	2008-01-12 03:44:59 UTC (rev 3344)
+++ libfishsound/branches/1.0-stable/src/libfishsound/comments.c	2008-01-12 04:04:10 UTC (rev 3345)
@@ -74,6 +74,8 @@
     if (*s == c) return (char *)s;
   }
 
+  if (i < len) return (char *)s;
+
   return NULL;
 }
 
@@ -453,12 +455,19 @@
    if (c+4>end) return -1;
 
    nb_fields=readint(c, 0);
+#ifdef DEBUG
+   printf ("fish_sound_comments_decode: %d comments\n", nb_fields);
+#endif
+
    c+=4;
    for (i=0;i<nb_fields;i++)
    {
       if (c+4>end) return -1;
 
       len=readint(c, 0);
+#ifdef DEBUG
+      printf ("fish_sound_comments_decode: [%d] len %d\n", i, len);
+#endif
 
       c+=4;
       if (c+len>end) return -1;
@@ -479,6 +488,10 @@
 	_fs_comment_add (fsound, comment);
 	fs_free (nvalue);
       } else {
+#ifdef DEBUG
+        printf ("fish_sound_comments_decode: [%d] %s (no value)\n",
+                i, name, len);
+#endif
 	nvalue = fs_strdup_len (name, len);
 	comment = fs_comment_new (nvalue, NULL);
 	_fs_comment_add (fsound, comment);



More information about the commits mailing list