[vlc-devel] commit: Fixed/workaround a segfault with (newer?) swscale version. ( Laurent Aimar )

git version control git at videolan.org
Thu Jun 4 22:35:10 CEST 2009


vlc | branch: 1.0-bugfix | Laurent Aimar <fenrir at videolan.org> | Thu Jun  4 22:27:53 2009 +0200| [21993ca4aa514c86619a8372f5552011ca6e4750] | committer: Jean-Baptiste Kempf 

Fixed/workaround a segfault with (newer?) swscale version.

Initialize the alpha plane pointers even when not used !
(cherry picked from commit 004e67b457e9a804dee124f24236a4a6a10f373f)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21993ca4aa514c86619a8372f5552011ca6e4750
---

 modules/video_filter/swscale.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/video_filter/swscale.c b/modules/video_filter/swscale.c
index 61d0d82..432fe8a 100644
--- a/modules/video_filter/swscale.c
+++ b/modules/video_filter/swscale.c
@@ -442,7 +442,7 @@ static void Clean( filter_t *p_filter )
     p_sys->p_dst_e = NULL;
 }
 
-static void GetPixels( uint8_t *pp_pixel[3], int pi_pitch[3],
+static void GetPixels( uint8_t *pp_pixel[4], int pi_pitch[4],
                        const picture_t *p_picture,
                        int i_plane_start, int i_plane_count )
 {
@@ -452,7 +452,7 @@ static void GetPixels( uint8_t *pp_pixel[3], int pi_pitch[3],
         pp_pixel[n] = p_picture->p[i_plane_start+n].p_pixels;
         pi_pitch[n] = p_picture->p[i_plane_start+n].i_pitch;
     }
-    for( ; n < 3; n++ )
+    for( ; n < 4; n++ )
     {
         pp_pixel[n] = NULL;
         pi_pitch[n] = 0;
@@ -505,8 +505,8 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx,
 {
     uint8_t palette[AVPALETTE_SIZE];
 
-    uint8_t *src[3]; int src_stride[3];
-    uint8_t *dst[3]; int dst_stride[3];
+    uint8_t *src[4]; int src_stride[4];
+    uint8_t *dst[4]; int dst_stride[4];
 
     GetPixels( src, src_stride, p_src, i_plane_start, i_plane_count );
     if( p_filter->fmt_in.video.i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'P' ) )




More information about the vlc-devel mailing list