Sign In  Sign Up Live-Chat

NegativeArraySizeException

Last post 12-16-2007, 12:49 PM by msfaiz. 6 replies.
Sort Posts: Previous Next
  •  12-03-2007, 1:16 PM 105018

    NegativeArraySizeException

    Hi,

    I get following exception if I try to load a big EMF file:

    java.lang.NegativeArraySizeException
        at com.aspose.metafiles.cV.do(SourceFile:772)
        at com.aspose.metafiles.EmfMetafile.do(SourceFile:57)
        at com.aspose.metafiles.EmfMetafile.<init>(SourceFile:39)

    IMHO, seems to be an overflow bug.

    Here is an example file:
    http://filespace.net/?d=65D753831

    Thank you,
    Stephan Michels.
     
  •  12-05-2007, 9:30 PM 105406 in reply to 105018

    Re: NegativeArraySizeException

    Thanks for reporting, we will investigate and fix this problem.
    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  12-09-2007, 8:40 PM 105704 in reply to 105018

    Re: NegativeArraySizeException

    Dear Stephan,

     

    The attached file by you namely negative-size.emf is actually a WMF metafile and has been misnamed. WmfMetafile reads it correctly. 


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  12-10-2007, 4:50 AM 105736 in reply to 105704

    Re: NegativeArraySizeException

    Thank you.

    Is it possible to throw an exception if I try to load WMF files with EmfMetafile? Maybe it is possible to search and check for a signature. I see often also an OutOfMemoryException if I try to load something different than WMF/EMF with Metafiles(I must search to find reproducible test case).

    ATM I can't really prevent incorrect files from being loaded with Metafiles. I can only check for exceptions and see if something goes wrong.

     
  •  12-10-2007, 6:52 AM 105743 in reply to 105736

    Re: NegativeArraySizeException

    Do you mean Aspose.Metafiles should throw some exception say NotWMFFile if you try to load EMF file using WMFMetafile?


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  12-10-2007, 7:27 AM 105745 in reply to 105743

    Re: NegativeArraySizeException

    Yes, you can reuse the MetafilesException if you want. But a RuntimeException, especially a  NegativeArraySizeException shouldn't occur.

    Thanks, Stephan.
     
  •  12-16-2007, 12:49 PM 106351 in reply to 105745

    Re: NegativeArraySizeException

    Dear Stephan,

     

    You can now download the latest version of Aspose.Metafiles 1.2.6.0 from this link.

    http://www.aspose.com/Community/Files/51/aspose.metafiles/default.aspx

     


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
View as RSS news feed in XML