diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c
index e7f9d00..bfad0ef 100644
--- a/libavcodec/faxcompr.c
+++ b/libavcodec/faxcompr.c
@@ -277,7 +277,7 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
     GetBitContext gb;
     int *runs, *ref = NULL, *runend;
     int ret;
-    int runsize= avctx->width + 2;
+    int runsize= 2 * avctx->width + 2;
     int err = 0;
     int has_eol;
 
