Index: postproc/swscale.c =================================================================== RCS file: /cvsroot/mplayer/main/postproc/swscale.c,v retrieving revision 1.148 diff -u -r1.148 swscale.c --- postproc/swscale.c 21 Jan 2005 16:48:18 -0000 1.148 +++ postproc/swscale.c 21 Jan 2005 17:18:28 -0000 @@ -61,6 +61,14 @@ #else #include #endif +#ifdef HAVE_SYS_MMAN_H +#include +#include +#include /* for PAGESIZE */ +#ifndef PAGESIZE +#define PAGESIZE 4096 +#endif +#endif #include "swscale.h" #include "swscale_internal.h" #include "../cpudetect.h" @@ -1999,6 +2007,18 @@ // can't downscale !!! if(c->canMMX2BeUsed && (flags & SWS_FAST_BILINEAR)) { +#ifdef HAVE_SYS_MMAN_H + void *y = (void *)(((intptr_t)c->funnyYCode - (PAGESIZE-1)) & ~(PAGESIZE-1)); + void *uv = (void *)(((intptr_t)c->funnyUVCode - (PAGESIZE-1)) & ~(PAGESIZE-1)); + int y_s = ((void*)c->funnyYCode-y) + sizeof(c->funnyYCode); + int uv_s = ((void*)c->funnyUVCode-uv) + sizeof(c->funnyUVCode); + if (mprotect(y, y_s, + PROT_EXEC | PROT_READ | PROT_WRITE) || + mprotect(uv, uv_s, + PROT_EXEC | PROT_READ | PROT_WRITE)) + MSG_ERR("swScaler: generated code may be NX\n"); +#endif + c->lumMmx2Filter = (int16_t*)memalign(8, (dstW /8+8)*sizeof(int16_t)); c->chrMmx2Filter = (int16_t*)memalign(8, (c->chrDstW /4+8)*sizeof(int16_t)); c->lumMmx2FilterPos= (int32_t*)memalign(8, (dstW /2/8+8)*sizeof(int32_t));