ext/gnomevfs/gstgnomevfssrc.c (gst_gnomevfssrc_received_headers_callback)

Original commit message from CVS:
2005-07-04  Andy Wingo  <wingo@pobox.com>

* ext/gnomevfs/gstgnomevfssrc.c
(gst_gnomevfssrc_received_headers_callback)
(audiocast_thread_kill, audiocast_thread_run): FORTIFY fixen,
hopefully.
This commit is contained in:
Andy Wingo 2005-07-04 14:12:41 +00:00
parent d1f752ff75
commit 7d4be3b71a
2 changed files with 17 additions and 9 deletions

View file

@ -1,5 +1,10 @@
2005-07-04 Andy Wingo <wingo@pobox.com> 2005-07-04 Andy Wingo <wingo@pobox.com>
* ext/gnomevfs/gstgnomevfssrc.c
(gst_gnomevfssrc_received_headers_callback)
(audiocast_thread_kill, audiocast_thread_run): FORTIFY fixen,
hopefully.
* gst/audioconvert/gstaudioconvert.c (gst_audio_convert_fixate): * gst/audioconvert/gstaudioconvert.c (gst_audio_convert_fixate):
No refcount leakage. No refcount leakage.

View file

@ -634,7 +634,8 @@ audiocast_thread_run (GstGnomeVFSSrc * src)
char buf[1]; char buf[1];
GST_DEBUG ("audiocast thread: got die character"); GST_DEBUG ("audiocast thread: got die character");
read (src->audiocast_thread_die_infd, buf, 1); if (read (src->audiocast_thread_die_infd, buf, 1) != 1)
g_warning ("gnomevfssrc: could not read from audiocast fd");
close (src->audiocast_thread_die_infd); close (src->audiocast_thread_die_infd);
close (src->audiocast_fd); close (src->audiocast_fd);
return NULL; return NULL;
@ -732,7 +733,8 @@ audiocast_thread_kill (GstGnomeVFSSrc * src)
audiocast metadata too. audiocast metadata too.
*/ */
GST_DEBUG ("audiocast: writing die character"); GST_DEBUG ("audiocast: writing die character");
write (src->audiocast_thread_die_outfd, "q", 1); if (write (src->audiocast_thread_die_outfd, "q", 1) != 1)
g_critical ("gnomevfssrc: could not write to audiocast thread fd");
close (src->audiocast_thread_die_outfd); close (src->audiocast_thread_die_outfd);
GST_DEBUG ("audiocast: joining thread"); GST_DEBUG ("audiocast: joining thread");
g_thread_join (src->audiocast_thread); g_thread_join (src->audiocast_thread);
@ -785,13 +787,14 @@ gst_gnomevfssrc_received_headers_callback (gconstpointer in,
continue; continue;
/* Icecast stuff */ /* Icecast stuff */
if (!strncmp (data, "icy-metaint:", 12)) { /* ugh */ if (strncmp (data, "icy-metaint:", 12) == 0) { /* ugh */
sscanf (data + 12, "%d", &icy_metaint); if (sscanf (data + 12, "%d", &icy_metaint) == 1) {
src->icy_metaint = icy_metaint; src->icy_metaint = icy_metaint;
GST_DEBUG ("got icy-metaint %d, killing audiocast thread", GST_DEBUG ("got icy-metaint %d, killing audiocast thread",
src->icy_metaint); src->icy_metaint);
audiocast_thread_kill (src); audiocast_thread_kill (src);
continue; continue;
}
} }
if (!strncmp (data, "icy-", 4)) if (!strncmp (data, "icy-", 4))