PDF: fix bugs in jbig2dec and openjpeg