[xiph-commits] r18721 - icecast/branches/ph3/libshout/src

ph3-der-loewe at svn.xiph.org ph3-der-loewe at svn.xiph.org
Fri Nov 23 15:13:38 PST 2012


Author: ph3-der-loewe
Date: 2012-11-23 15:13:38 -0800 (Fri, 23 Nov 2012)
New Revision: 18721

Modified:
   icecast/branches/ph3/libshout/src/shout.c
Log:
avoid segfault in case self is NULL. Thanks to stephan48.

Modified: icecast/branches/ph3/libshout/src/shout.c
===================================================================
--- icecast/branches/ph3/libshout/src/shout.c	2012-11-23 22:29:49 UTC (rev 18720)
+++ icecast/branches/ph3/libshout/src/shout.c	2012-11-23 23:13:38 UTC (rev 18721)
@@ -639,17 +639,15 @@
 int shout_set_audio_info(shout_t *self, const char *name, const char *value)
 {
 	if (!self)
-		return self->error = SHOUTERR_INSANE;
+		return SHOUTERR_INSANE;
 
 	return self->error = _shout_util_dict_set(self->audio_info, name, value);
 }
 
 const char *shout_get_audio_info(shout_t *self, const char *name)
 {
-	if (!self) {
-		self->error = SHOUTERR_INSANE;
+	if (!self)
 		return NULL;
-	}
 
 	return _shout_util_dict_get(self->audio_info, name);
 }
@@ -659,7 +657,7 @@
 	size_t i;
 
 	if (!self)
-		return self->error = SHOUTERR_INSANE;
+		return SHOUTERR_INSANE;
 
 	if (self->state != SHOUT_STATE_UNCONNECTED)
 		return self->error = SHOUTERR_CONNECTED;
@@ -673,10 +671,8 @@
 
 const char *shout_get_meta(shout_t *self, const char *name)
 {
-	if (!self) {
-		self->error = SHOUTERR_INSANE;
+	if (!self)
 		return NULL;
-	}
 
 	return _shout_util_dict_get(self->meta, name);
 }



More information about the commits mailing list