diff --git a/postproc/rgb2rgb_template.c b/postproc/rgb2rgb_template.c
index 81d274b2254bc5d77fa28fa97b205c64690e73c3..14f0e2de517cd388f891303507136de571d9cf52 100644
--- a/postproc/rgb2rgb_template.c
+++ b/postproc/rgb2rgb_template.c
@@ -2291,7 +2291,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
 			"movd %%mm0, (%3, %%eax)	\n\t"
 			"addl $4, %%eax			\n\t"
 			" js 1b				\n\t"
-			: : "r" (src+width*6), "r" (src+srcStride+width*6), "r" (udst+width), "r" (vdst+width), "g" (-width)
+			: : "r" (src+chromWidth*6), "r" (src+srcStride+chromWidth*6), "r" (udst+chromWidth), "r" (vdst+chromWidth), "g" (-chromWidth)
 			: "%eax", "%ebx"
 		);