X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fdll%2F3rdparty%2Flibjpeg%2Frdswitch.c;h=b5aba83cb8a6d4b96d878db134114c45e99d78f7;hp=7a839af7a4f836bfc46dc9319e43d4fefae8cd3d;hb=ebf8247723f6a2e4d76a2e3ade72c71e30023200;hpb=d92f2f5ea11346bc783d7de09f2121c229e407c8 diff --git a/reactos/dll/3rdparty/libjpeg/rdswitch.c b/reactos/dll/3rdparty/libjpeg/rdswitch.c index 7a839af7a4f..b5aba83cb8a 100644 --- a/reactos/dll/3rdparty/libjpeg/rdswitch.c +++ b/reactos/dll/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;