[MPlayer-dev-eng] [PATCH] freesdp crashes after failed initialization

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Aug 17 01:31:25 CEST 2006


Hello,
freesdp code seems to crash on uninit when initialization was aborted,
since dsc->media_announcements_count is set before all data is
allocated, cause a NULL pointer dereference.
Attached patch okay?

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: stream/freesdp/common.c
===================================================================
--- stream/freesdp/common.c	(revision 19414)
+++ stream/freesdp/common.c	(working copy)
@@ -166,6 +166,7 @@
 
   for (i = 0; i < dsc->media_announcements_count; i++)
   {
+    if (!dsc->media_announcements[i]) continue;
     for (j = 0; j < dsc->media_announcements[i]->formats_count; j++)
       safe_free (dsc->media_announcements[i]->formats[j]);
     safe_free (dsc->media_announcements[i]->formats);


More information about the MPlayer-dev-eng mailing list