From feecf1b6669c83822b59eae41dacc5e01b96a26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 10 Jan 2006 18:06:56 +0000 Subject: [PATCH] ext/cdparanoia/gstcdparanoiasrc.c: Don't try to free NULL pointers. Original commit message from CVS: * ext/cdparanoia/gstcdparanoiasrc.c: (gst_cd_paranoia_src_close), (gst_cd_paranoia_paranoia_callback): Don't try to free NULL pointers. --- ChangeLog | 6 ++++++ ext/cdparanoia/gstcdparanoiasrc.c | 16 +++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf7342f784..3303f0ba4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-01-10 Tim-Philipp Müller + + * ext/cdparanoia/gstcdparanoiasrc.c: (gst_cd_paranoia_src_close), + (gst_cd_paranoia_paranoia_callback): + Don't try to free NULL pointers. + 2006-01-10 Edward Hervey * gst/audiorate/gstaudiorate.c: (gst_audio_rate_chain), diff --git a/ext/cdparanoia/gstcdparanoiasrc.c b/ext/cdparanoia/gstcdparanoiasrc.c index dfc758981b..6747f1b842 100644 --- a/ext/cdparanoia/gstcdparanoiasrc.c +++ b/ext/cdparanoia/gstcdparanoiasrc.c @@ -236,11 +236,15 @@ gst_cd_paranoia_src_close (GstCddaBaseSrc * cddabasesrc) { GstCdParanoiaSrc *src = GST_CD_PARANOIA_SRC (cddabasesrc); - paranoia_free (src->p); - src->p = NULL; + if (src->p) { + paranoia_free (src->p); + src->p = NULL; + } - cdda_close (src->d); - src->d = NULL; + if (src->d) { + cdda_close (src->d); + src->d = NULL; + } src->next_sector = -1; } @@ -248,7 +252,9 @@ gst_cd_paranoia_src_close (GstCddaBaseSrc * cddabasesrc) static void gst_cd_paranoia_paranoia_callback (long inpos, int function) { - /* do nothing for now, maybe emit signals later */ + /* There is not much we can do here (not without a lot of trickery + * at least), since we don't have a pointer to our own element or at + * least the cdparanoia object */ } static GstBuffer *