Jpeg test suite has invalid image. It was introduced due to the index out of range exception but right now it's used to actually test jpeg decoder with reference image.
This image is invalid according to the itu spec:

As it has Hi parameter equal to 10:

Current implementation does not validate this value in any way and tries to decode spectral data with input parameters. Test suite assumes this image to be parsable just because libjpeg can parse it. Problem is that this image is small enough not to be affected by artifacts, any real world size image would produce pixel mess with invalid sampling rate. Thus this image should not be used to test decoder.
As for the solution, we can force invalid values to 1 or do % 4 but I don't think it's a good way to handle this. It's more convenient to get an exception of what is wrong (ideally with byte(s) start index) rather than random collection of pixels.
P.S.
This is not really relevant to the 'no itu spec compliance' reasoning but it also blocks my decoder optimization with ugly redundant checks.