Mercurial > audlegacy-plugins
diff src/madplug/plugin.c @ 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 | b9167008fc3f |
| children | e6a1ba5185ba |
line wrap: on
line diff
--- 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,
