[MPlayer-cvslog] r30158 - trunk/libmpcodecs/vf_scale.c

reimar subversion at mplayerhq.hu
Fri Jan 1 02:06:34 CET 2010


Author: reimar
Date: Fri Jan  1 02:06:34 2010
New Revision: 30158

Log:
Also pass alpha plane to swscale, avoids crashes when converting between
YUV with alpha and some other format supporting alpha.

Modified:
   trunk/libmpcodecs/vf_scale.c

Modified: trunk/libmpcodecs/vf_scale.c
==============================================================================
--- trunk/libmpcodecs/vf_scale.c	Fri Jan  1 00:45:07 2010	(r30157)
+++ trunk/libmpcodecs/vf_scale.c	Fri Jan  1 02:06:34 2010	(r30158)
@@ -331,7 +331,7 @@ static void start_slice(struct vf_instan
 
 static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src[MP_MAX_PLANES], int src_stride[MP_MAX_PLANES],
                   int y, int h,  uint8_t *dst[MP_MAX_PLANES], int dst_stride[MP_MAX_PLANES], int interlaced){
-    uint8_t *src2[MP_MAX_PLANES]={src[0], src[1], src[2]};
+    uint8_t *src2[MP_MAX_PLANES]={src[0], src[1], src[2], src[3]};
 #if HAVE_BIGENDIAN
     uint32_t pal2[256];
     if (src[1] && !src[2]){
@@ -344,9 +344,9 @@ static void scale(struct SwsContext *sws
 
     if(interlaced){
         int i;
-        uint8_t *dst2[MP_MAX_PLANES]={dst[0], dst[1], dst[2]};
-        int src_stride2[MP_MAX_PLANES]={2*src_stride[0], 2*src_stride[1], 2*src_stride[2]};
-        int dst_stride2[MP_MAX_PLANES]={2*dst_stride[0], 2*dst_stride[1], 2*dst_stride[2]};
+        uint8_t *dst2[MP_MAX_PLANES]={dst[0], dst[1], dst[2], dst[3]};
+        int src_stride2[MP_MAX_PLANES]={2*src_stride[0], 2*src_stride[1], 2*src_stride[2], 2*src_stride[3]};
+        int dst_stride2[MP_MAX_PLANES]={2*dst_stride[0], 2*dst_stride[1], 2*dst_stride[2], 2*dst_stride[3]};
 
         sws_scale_ordered(sws1, src2, src_stride2, y>>1, h>>1, dst2, dst_stride2);
         for(i=0; i<3; i++){


More information about the MPlayer-cvslog mailing list