Commit baba2eed authored by Ronald S. Bultje's avatar Ronald S. Bultje

swscale: extend mmx padding.

Fixes a crash when forcing libc to strictly adhere to malloc sizes.
parent 55eda370
...@@ -1049,19 +1049,20 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) ...@@ -1049,19 +1049,20 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
//Note we need at least one pixel more at the end because of the MMX code (just in case someone wanna replace the 4000/8000) //Note we need at least one pixel more at the end because of the MMX code (just in case someone wanna replace the 4000/8000)
/* align at 16 bytes for AltiVec */ /* align at 16 bytes for AltiVec */
for (i=0; i<c->vLumBufSize; i++) { for (i=0; i<c->vLumBufSize; i++) {
FF_ALLOCZ_OR_GOTO(c, c->lumPixBuf[i+c->vLumBufSize], dst_stride+1, fail); FF_ALLOCZ_OR_GOTO(c, c->lumPixBuf[i+c->vLumBufSize], dst_stride+16, fail);
c->lumPixBuf[i] = c->lumPixBuf[i+c->vLumBufSize]; c->lumPixBuf[i] = c->lumPixBuf[i+c->vLumBufSize];
} }
c->uv_off_px = dst_stride_px; // 64 / c->scalingBpp is the same as 16 / sizeof(scaling_intermediate)
c->uv_off_byte = dst_stride; c->uv_off_px = dst_stride_px + 64 / c->scalingBpp;
c->uv_off_byte = dst_stride + 16;
for (i=0; i<c->vChrBufSize; i++) { for (i=0; i<c->vChrBufSize; i++) {
FF_ALLOC_OR_GOTO(c, c->chrUPixBuf[i+c->vChrBufSize], dst_stride*2+1, fail); FF_ALLOC_OR_GOTO(c, c->chrUPixBuf[i+c->vChrBufSize], dst_stride*2+32, fail);
c->chrUPixBuf[i] = c->chrUPixBuf[i+c->vChrBufSize]; c->chrUPixBuf[i] = c->chrUPixBuf[i+c->vChrBufSize];
c->chrVPixBuf[i] = c->chrVPixBuf[i+c->vChrBufSize] = c->chrUPixBuf[i] + (dst_stride >> 1); c->chrVPixBuf[i] = c->chrVPixBuf[i+c->vChrBufSize] = c->chrUPixBuf[i] + (dst_stride >> 1) + 8;
} }
if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
for (i=0; i<c->vLumBufSize; i++) { for (i=0; i<c->vLumBufSize; i++) {
FF_ALLOCZ_OR_GOTO(c, c->alpPixBuf[i+c->vLumBufSize], dst_stride+1, fail); FF_ALLOCZ_OR_GOTO(c, c->alpPixBuf[i+c->vLumBufSize], dst_stride+16, fail);
c->alpPixBuf[i] = c->alpPixBuf[i+c->vLumBufSize]; c->alpPixBuf[i] = c->alpPixBuf[i+c->vLumBufSize];
} }
......
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