changeset 653:638b290641f3 trunk

[svn] - madplug: check that text is not null before using g_strtod
author giacomo
date Thu, 15 Feb 2007 05:10:08 -0800
parents 7f865e3cd285
children 8bd5fae12b9c
files ChangeLog src/madplug/plugin.c
diffstat 2 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Feb 14 23:23:21 2007 -0800
+++ b/ChangeLog	Thu Feb 15 05:10:08 2007 -0800
@@ -1,3 +1,11 @@
+2007-02-15 07:23:21 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
+  revision [1390]
+  - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
+  
+  trunk/src/xspf/xspf.c |   27 ++++++++++++++++++++++++++-
+  1 file changed, 26 insertions(+), 1 deletion(-)
+
+
 2007-02-15 02:03:22 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
   revision [1388]
   - strings in audmad_config should be freed before update. thus constant initializer has been replaced with g_strdup().
--- a/src/madplug/plugin.c	Wed Feb 14 23:23:21 2007 -0800
+++ b/src/madplug/plugin.c	Thu Feb 15 05:10:08 2007 -0800
@@ -81,13 +81,19 @@
     gdouble x;
 
     text = config->pregain_db;
-    x = g_strtod(text, NULL);
+    if ( text != NULL )
+      x = g_strtod(text, NULL);
+    else
+      x = 0;
     config->pregain_scale = (x != 0) ? pow(10.0, x / 20) : 1;
 #ifdef DEBUG
     g_message("pregain=[%s] -> %g  -> %g", text, x, config->pregain_scale);
 #endif
     text = config->replaygain.default_db;
-    x = g_strtod(text, NULL);
+    if ( text != NULL )
+      x = g_strtod(text, NULL);
+    else
+      x = 0;
     config->replaygain.default_scale = (x != 0) ? pow(10.0, x / 20) : 1;
 #ifdef DEBUG
     g_message("RG.default=[%s] -> %g  -> %g", text, x,