From 010411e535ec27060bee56b49aabeab7dcf6c794 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 20 Nov 2009 11:46:20 +0000 Subject: [PATCH] From David Callu, "I have a Segfault with xine plugin, when I load a video, then delete the XineStreamImage, then reload a video and finally delete the second XineStreamImage. In src/osgPlugins/xine/video_out_rgb.c, many code is ASM code, and 'clear()' function is one of them. If OSG is compiled without the flag COMPILE_ASSEMBLY (default behaviours) the clear() function is an empty function and allocated memory is never initialized to 0. So a structure which contain pointer haven't its pointer set to NULL. And when we need to delete this pointer, all go bad. I join the fixed file." --- src/osgPlugins/xine/video_out_rgb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/osgPlugins/xine/video_out_rgb.c b/src/osgPlugins/xine/video_out_rgb.c index c5e6927b2..9f4db3286 100644 --- a/src/osgPlugins/xine/video_out_rgb.c +++ b/src/osgPlugins/xine/video_out_rgb.c @@ -100,6 +100,8 @@ clear(void* dest, uint32_t size) : "=&D" (dest) : "r" (size >> 2), "r" (size & 3), "0" (dest) : "eax", "ecx"); +#else + memset(dest, 0, size); #endif }