Daniel-Glucksman / JBig2Decoder.NET

A .Net Implementation of the JPedal JBig2 Decoder
MIT License
10 stars 4 forks source link

StackOverflow exception provoked in HalftoneRegionSegment.readSegment() method. #2

Open samconn opened 7 years ago

samconn commented 7 years ago

This library is used in the Telerik PDFViewer control and I stumbled across a PDF that provokes an exception due to the following code:

    public override void readSegment()
    {
        readSegment();

        readHalftoneRegionFlags();
        ...
        ...
        ...

I tracked down the original JPedal JBig2 Decoder source and found that the original call is super.readSegment().

I made that change in my version of the source code and the problem did not reproduce.

(I apologize for not submitting a PR.)

r-win commented 7 years ago

Since this morning I've got the same exception, but I'm using this component myself.

I've applied your fix, to our codebase as well, and that seems to fix the problem Thanks for finding that out!

samconn commented 7 years ago

In life ... timing is everything!!! ;-}