From: <th...@ke...> - 2006-05-19 14:06:11
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: thaytan Date: Fri May 19 2006 14:06:05 UTC Log message: * gst/id3demux/id3v2frames.c: (id3v2_tag_to_taglist): Don't output any tag when we encounter a negative track number - the tag type is uint, so we end up outputting huge positive numbers instead. (Fixes: #342029) Modified files: . : ChangeLog gst/id3demux : id3v2frames.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.2351&r2=1.2352 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/id3demux/id3v2frames.c.diff?r1=1.18&r2=1.19 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.2351 retrieving revision 1.2352 diff -u -d -r1.2351 -r1.2352 --- ChangeLog 18 May 2006 23:04:59 -0000 1.2351 +++ ChangeLog 19 May 2006 14:05:53 -0000 1.2352 @@ -1,3 +1,10 @@ +2006-05-19 Jan Schmidt <th...@ma...> + + * gst/id3demux/id3v2frames.c: (id3v2_tag_to_taglist): + Don't output any tag when we encounter a negative track number - the + tag type is uint, so we end up outputting huge positive numbers + instead. (Fixes: #342029) 2006-05-19 Thomas Vander Stichele <thomas at apestaart dot org> * configure.ac: Index: id3v2frames.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/id3demux/id3v2frames.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- id3v2frames.c 16 May 2006 14:07:29 -0000 1.18 +++ id3v2frames.c 19 May 2006 14:05:53 -0000 1.19 @@ -450,41 +450,34 @@ switch (tag_type) { case G_TYPE_UINT: { - guint tmp; - gchar *check; - - tmp = strtoul ((char *) tag_str, &check, 10); - if (strcmp (tag_name, GST_TAG_TRACK_NUMBER) == 0) { - if (*check == '/') { - guint total; - check++; - total = strtoul (check, &check, 10); - if (*check != '\0') - break; - gst_tag_list_add (tag_list, GST_TAG_MERGE_APPEND, - GST_TAG_TRACK_COUNT, total, NULL); - } - } else if (strcmp (tag_name, GST_TAG_ALBUM_VOLUME_NUMBER) == 0) { + gint current, total; - GST_TAG_ALBUM_VOLUME_COUNT, total, NULL); + if (sscanf (tag_str, "%d/%d", ¤t, &total) == 2) { + if (total < 0) { + GST_WARNING ("Ignoring negative value for total %d in tag %s", + total, tag_name); + } else { + if (strcmp (tag_name, GST_TAG_TRACK_NUMBER) == 0) { + gst_tag_list_add (tag_list, GST_TAG_MERGE_APPEND, + GST_TAG_TRACK_COUNT, total, NULL); + } else if (strcmp (tag_name, GST_TAG_ALBUM_VOLUME_NUMBER) == 0) { + GST_TAG_ALBUM_VOLUME_COUNT, total, NULL); + } } - } - if (*check != '\0') + } else if (sscanf (tag_str, "%d", ¤t) != 1) { + /* Not an integer in the string */ + GST_WARNING ("Tag string for tag %s does not contain an integer - " + "ignoring", tag_name); break; + } - gst_tag_list_add (tag_list, GST_TAG_MERGE_APPEND, tag_name, tmp, NULL); + if (current < 0) + GST_WARNING ("Ignoring negative value %d in tag %s", current, tag_name); + else { + gst_tag_list_add (tag_list, GST_TAG_MERGE_APPEND, tag_name, current, + NULL); break; } case G_TYPE_UINT64: |