[LIBJPEG]
[reactos.git] / reactos / dll / 3rdparty / libjpeg / rdswitch.c
index 7a839af..b5aba83 100644 (file)
@@ -2,6 +2,7 @@
  * rdswitch.c
  *
  * Copyright (C) 1991-1996, Thomas G. Lane.
+ * Modified 2003-2015 by Guido Vollbeding.
  * This file is part of the Independent JPEG Group's software.
  * For conditions of distribution and use, see the accompanying README file.
  *
@@ -347,8 +348,9 @@ set_sample_factors (j_compress_ptr cinfo, char *arg)
        return FALSE;
       if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */
        return FALSE;
-      if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {
-       fprintf(stderr, "JPEG sampling factors must be 1..4\n");
+      if (val1 <= 0 || val1 > MAX_SAMP_FACTOR ||
+         val2 <= 0 || val2 > MAX_SAMP_FACTOR) {
+       fprintf(stderr, "JPEG sampling factors must be 1..%d\n", MAX_SAMP_FACTOR);
        return FALSE;
       }
       cinfo->comp_info[ci].h_samp_factor = val1;