#fixed code
                                @Test
    public void loadPNGWithoutUsingImageSizeAndForceWidth()
        throws Exception
    {
        IImageProvider imageProvider =
            new ByteArrayImageProvider( ByteArrayImageProviderTestCase.class.getResourceAsStream( "logo.png" ) );
        imageProvider.setWidth( 100f );
        Assert.assertEquals( ImageFormat.png, imageProvider.getImageFormat() );
        Assert.assertNotNull( imageProvider.getWidth(null) );
        Assert.assertEquals( 100f, imageProvider.getWidth(null).floatValue(), 0 );
        Assert.assertNull( imageProvider.getHeight(null) );
    }
#vulnerable code 
                                @Test
    public void loadPNGWithoutUsingImageSizeAndForceWidth()
        throws Exception
    {
        IImageProvider imageProvider =
            new ByteArrayImageProvider( ByteArrayImageProviderTestCase.class.getResourceAsStream( "logo.png" ) );
        imageProvider.setWidth( 100f );
        Assert.assertEquals( ImageFormat.png, imageProvider.getImageFormat() );
        Assert.assertNotNull( imageProvider.getWidth(0) );
        Assert.assertEquals( 100f, imageProvider.getWidth(0).floatValue(), 0 );
        Assert.assertNull( imageProvider.getHeight(0) );
    } 
                            #location 10 
                            #vulnerability type NULL_DEREFERENCE