Commit eb4205cc authored by Michael Niedermayer's avatar Michael Niedermayer

swscale/utils: check mprotect() return code

Found-by: wm4
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fdb48225
...@@ -1430,8 +1430,11 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, ...@@ -1430,8 +1430,11 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
c->hChrFilter, (uint32_t*)c->hChrFilterPos, 4); c->hChrFilter, (uint32_t*)c->hChrFilterPos, 4);
#if USE_MMAP #if USE_MMAP
mprotect(c->lumMmxextFilterCode, c->lumMmxextFilterCodeSize, PROT_EXEC | PROT_READ); if ( mprotect(c->lumMmxextFilterCode, c->lumMmxextFilterCodeSize, PROT_EXEC | PROT_READ) == -1
mprotect(c->chrMmxextFilterCode, c->chrMmxextFilterCodeSize, PROT_EXEC | PROT_READ); || 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 #endif
} else } else
#endif /* HAVE_MMXEXT_INLINE */ #endif /* HAVE_MMXEXT_INLINE */
......
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