[JP3D] To avoid divisions by zero / undefined behaviour on shift (CVE-2018-14423