@Test
public void retrievePageLabelsOnMalformedPdf() throws IOException
{

    PDDocument doc = null;
    try
    {
        doc = PDDocument.load(TestPDDocumentCatalog.class.getResourceAsStream("/pdfbox/com/tom_roush/pdfbox/pdmodel/badpagelabels.pdf"));
        PDDocumentCatalog cat = doc.getDocumentCatalog();
        // getLabelsByPageIndices() should not throw an exception
        cat.getPageLabels().getLabelsByPageIndices();
    }
    finally
    {
        if(doc != null)
        {
            doc.close();
        }
    }
}