diff --git a/quantsmooth.c b/quantsmooth.c index e9cf8f9..d1d7b7e 100644 --- a/quantsmooth.c +++ b/quantsmooth.c @@ -528,6 +528,10 @@ int main(int argc, char **argv) { (void) jpeg_read_header(&srcinfo, TRUE); coef_arrays = jpeg_read_coefficients(&srcinfo); + if (coef_arrays == NULL) { + logfmt(LS ": can't read coefficients\n", progname); + return 1; + } do_quantsmooth(&srcinfo, coef_arrays, &opts); jpeg_copy_critical_parameters(&srcinfo, &dstinfo);