diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index 21a16e91b2d870c96e1daf8539e30e99d94cd20a..4b5503ccd9440d5a63f7ee428063dff3c2f847e9 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -871,7 +871,7 @@ static void reallocBuffers(PPContext *c, int width, int height, int stride, int
     c->stride= stride;
     c->qpStride= qpStride;
 
-    reallocAlign((void **)&c->tempDst, 8, stride*24);
+    reallocAlign((void **)&c->tempDst, 8, stride*24+32);
     reallocAlign((void **)&c->tempSrc, 8, stride*24);
     reallocAlign((void **)&c->tempBlocks, 8, 2*16*8);
     reallocAlign((void **)&c->yHistogram, 8, 256*sizeof(uint64_t));
diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c
index a6fe783511e0bce0dd148a4f60e13bc5e23bda07..4152f6713197819187d51943704d4aae436eebb7 100644
--- a/libpostproc/postprocess_template.c
+++ b/libpostproc/postprocess_template.c
@@ -3260,7 +3260,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[
     //FIXME remove
     uint64_t * const yHistogram= c.yHistogram;
     uint8_t * const tempSrc= srcStride > 0 ? c.tempSrc : c.tempSrc - 23*srcStride;
-    uint8_t * const tempDst= dstStride > 0 ? c.tempDst : c.tempDst - 23*dstStride;
+    uint8_t * const tempDst= (dstStride > 0 ? c.tempDst : c.tempDst - 23*dstStride) + 32;
     //const int mbWidth= isColor ? (width+7)>>3 : (width+15)>>4;
 
 #if TEMPLATE_PP_MMX