[SCM] libav/experimental: Fix segfault with rgb24 and full_internal_chrome due to non existing alpha byte being written after the array.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:30:13 UTC 2013


The following commit has been merged in the experimental branch:
commit d616c8ae3dcce2e00b69d9b31f52aaa6b68ce19c
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Tue Sep 16 03:49:54 2008 +0000

    Fix segfault with rgb24 and full_internal_chrome due to non existing alpha
    byte being written after the array.
    
    Originally committed as revision 27628 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 56a349c..a7c42c8 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -905,29 +905,34 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
 {
     int i;
     int step= fmt_depth(c->dstFormat)/8;
+    int aidx= 3;
 
     switch(c->dstFormat){
     case PIX_FMT_ARGB:
         dest++;
+        aidx= 0;
     case PIX_FMT_RGB24:
+        aidx--;
     case PIX_FMT_RGBA:
         YSCALE_YUV_2_RGBX_FULL_C(1<<21)
+            dest[aidx]= 0;
             dest[0]= R>>22;
             dest[1]= G>>22;
             dest[2]= B>>22;
-            dest[3]= 0;
             dest+= step;
         }
         break;
     case PIX_FMT_ABGR:
         dest++;
+        aidx= 0;
     case PIX_FMT_BGR24:
+        aidx--;
     case PIX_FMT_BGRA:
         YSCALE_YUV_2_RGBX_FULL_C(1<<21)
+            dest[aidx]= 0;
             dest[0]= B>>22;
             dest[1]= G>>22;
             dest[2]= R>>22;
-            dest[3]= 0;
             dest+= step;
         }
         break;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list