diff options
Diffstat (limited to '3rdparty/libjpeg/rdswitch.c')
-rw-r--r-- | 3rdparty/libjpeg/rdswitch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/3rdparty/libjpeg/rdswitch.c b/3rdparty/libjpeg/rdswitch.c index 7a839af7a4f..b5aba83cb8a 100644 --- a/3rdparty/libjpeg/rdswitch.c +++ b/3rdparty/libjpeg/rdswitch.c @@ -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; |