Commit f7e3ebb6 authored by michael's avatar michael

Fix segfault with rgb24 and full_internal_chrome due to non existing alpha

byte being written after the array.


git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@27628 b3059339-0415-0410-9bf9-f77b7e298cf2
parent f438d5b2
...@@ -905,29 +905,34 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t * ...@@ -905,29 +905,34 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
{ {
int i; int i;
int step= fmt_depth(c->dstFormat)/8; int step= fmt_depth(c->dstFormat)/8;
int aidx= 3;
switch(c->dstFormat){ switch(c->dstFormat){
case PIX_FMT_ARGB: case PIX_FMT_ARGB:
dest++; dest++;
aidx= 0;
case PIX_FMT_RGB24: case PIX_FMT_RGB24:
aidx--;
case PIX_FMT_RGBA: case PIX_FMT_RGBA:
YSCALE_YUV_2_RGBX_FULL_C(1<<21) YSCALE_YUV_2_RGBX_FULL_C(1<<21)
dest[aidx]= 0;
dest[0]= R>>22; dest[0]= R>>22;
dest[1]= G>>22; dest[1]= G>>22;
dest[2]= B>>22; dest[2]= B>>22;
dest[3]= 0;
dest+= step; dest+= step;
} }
break; break;
case PIX_FMT_ABGR: case PIX_FMT_ABGR:
dest++; dest++;
aidx= 0;
case PIX_FMT_BGR24: case PIX_FMT_BGR24:
aidx--;
case PIX_FMT_BGRA: case PIX_FMT_BGRA:
YSCALE_YUV_2_RGBX_FULL_C(1<<21) YSCALE_YUV_2_RGBX_FULL_C(1<<21)
dest[aidx]= 0;
dest[0]= B>>22; dest[0]= B>>22;
dest[1]= G>>22; dest[1]= G>>22;
dest[2]= R>>22; dest[2]= R>>22;
dest[3]= 0;
dest+= step; dest+= step;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment