Lower the limit of image dimensions for fax codecs.

Use the same limit as JBIG2 codecs.

BUG=chromium:834633

Change-Id: I11d12c841e10ab48fd85df792bf8a034fe40493c
Reviewed-on: https://pdfium-review.googlesource.com/32514
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
diff --git a/core/fxcodec/codec/fx_codec_fax.cpp b/core/fxcodec/codec/fx_codec_fax.cpp
index 9739101..8c4b215 100644
--- a/core/fxcodec/codec/fx_codec_fax.cpp
+++ b/core/fxcodec/codec/fx_codec_fax.cpp
@@ -45,8 +45,8 @@
     4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8,
 };
 
-// Limit of image dimension, an arbitrary large number.
-const int kMaxImageDimension = 0x01FFFF;
+// Limit of image dimension. Use the same limit as the JBIG2 codecs.
+const int kMaxImageDimension = 65535;
 
 int FindBit(const uint8_t* data_buf, int max_pos, int start_pos, bool bit) {
   ASSERT(start_pos >= 0);