j2kdec: merge length==0 check from jpeg2000