From e4a71d081875ccb46e4e808b5e738f8b867df355 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 16 Sep 2008 03:49:54 +0000 Subject: Fix segfault with rgb24 and full_internal_chroma due to non-existing alpha byte being written after the array. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27628 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 56a349c811..a7c42c8371 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; -- cgit v1.2.3