diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index 3725979bd1e625f943adcfb78d41564ec6e2472a..e725a3bb0a952fde08d52af2f629f48f1691e4ec 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -102,7 +102,7 @@
 			"mov (%%"REG_d"), %%"REG_S"	\n\t"\
 			"jb 1b				\n\t"\
                         :: "r" (&c->redDither),\
-                        "r" (dest), "p" (width)\
+                        "r" (dest), "g" (width)\
                         : "%"REG_a, "%"REG_d, "%"REG_S\
                 );
 
@@ -164,7 +164,7 @@
 			"mov (%%"REG_d"), %%"REG_S"	\n\t"\
 			"jb 1b				\n\t"\
                         :: "r" (&c->redDither),\
-                        "r" (dest), "p" (width)\
+                        "r" (dest), "g" (width)\
                         : "%"REG_a, "%"REG_d, "%"REG_S\
                 );