swscale/utils: check mprotect() return code

Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-10-23 10:14:05 +02:00
parent fdb4822559
commit eb4205cc89

View File

@ -1430,8 +1430,11 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
c->hChrFilter, (uint32_t*)c->hChrFilterPos, 4);
#if USE_MMAP
mprotect(c->lumMmxextFilterCode, c->lumMmxextFilterCodeSize, PROT_EXEC | PROT_READ);
mprotect(c->chrMmxextFilterCode, c->chrMmxextFilterCodeSize, PROT_EXEC | PROT_READ);
if ( mprotect(c->lumMmxextFilterCode, c->lumMmxextFilterCodeSize, PROT_EXEC | PROT_READ) == -1
|| mprotect(c->chrMmxextFilterCode, c->chrMmxextFilterCodeSize, PROT_EXEC | PROT_READ) == -1) {
av_log(c, AV_LOG_ERROR, "mprotect failed, cannot use fast bilinear scaler\n");
goto fail;
}
#endif
} else
#endif /* HAVE_MMXEXT_INLINE */