From 5d8533d7f23d38f957e6480db0eb719a59ecb82f Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 29 Jun 2002 20:50:11 +0000 Subject: [PATCH] fixing memory overwrite bugs again ... git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6606 b3059339-0415-0410-9bf9-f77b7e298cf2 --- postproc/rgb2rgb_template.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/postproc/rgb2rgb_template.c b/postproc/rgb2rgb_template.c index b6c26a11ee..464ad4c269 100644 --- a/postproc/rgb2rgb_template.c +++ b/postproc/rgb2rgb_template.c @@ -63,13 +63,13 @@ static inline void RENAME(rgb24to32)(const uint8_t *src,uint8_t *dst,unsigned sr const uint8_t *s = src; const uint8_t *end; #ifdef HAVE_MMX - uint8_t *mm_end; + const uint8_t *mm_end; #endif end = s + src_size; #ifdef HAVE_MMX __asm __volatile(PREFETCH" %0"::"m"(*s):"memory"); + mm_end = end - 23; __asm __volatile("movq %0, %%mm7"::"m"(mask32):"memory"); - mm_end = (uint8_t*)((((unsigned long)end)/24)*24); while(s < mm_end) { __asm __volatile( @@ -114,12 +114,12 @@ static inline void RENAME(rgb32to24)(const uint8_t *src,uint8_t *dst,unsigned sr const uint8_t *s = src; const uint8_t *end; #ifdef HAVE_MMX - uint8_t *mm_end; + const uint8_t *mm_end; #endif end = s + src_size; #ifdef HAVE_MMX __asm __volatile(PREFETCH" %0"::"m"(*s):"memory"); - mm_end = (uint8_t*)((((unsigned long)end)/32)*32); + mm_end = end - 31; while(s < mm_end) { __asm __volatile( @@ -196,12 +196,12 @@ static inline void RENAME(rgb15to16)(const uint8_t *src,uint8_t *dst,unsigned sr register const uint8_t* s=src; register uint8_t* d=dst; register const uint8_t *end; - uint8_t *mm_end; + const uint8_t *mm_end; end = s + src_size; #ifdef HAVE_MMX __asm __volatile(PREFETCH" %0"::"m"(*s)); __asm __volatile("movq %0, %%mm4"::"m"(mask15s)); - mm_end = (uint8_t*)((((unsigned long)end)/16)*16); + mm_end = end - 15; while(s