changeset 19479:8dd04ec733f5

100l: *chapter_name was copied from the pointer rather than strupd()-ed (and next free()d in mplayer.c
author nicodvb
date Mon, 21 Aug 2006 19:52:11 +0000
parents bab82c53e433
children 735714372953
files libmpdemux/demuxer.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demuxer.c	Mon Aug 21 19:19:00 2006 +0000
+++ b/libmpdemux/demuxer.c	Mon Aug 21 19:52:11 2006 +0000
@@ -1135,8 +1135,11 @@
         if(num_chapters)
             *num_chapters = demuxer->num_chapters;
 
-        if(chapter_name)
-            *chapter_name = demuxer->chapters[current].name;
+        if(chapter_name) {
+            if(demuxer->chapters[current].name)
+                *chapter_name = strdup(demuxer->chapters[current].name);
+            else *chapter_name = NULL;
+        }
 
         return current;
     }