Code Monkey home page Code Monkey logo

Comments (8)

lucianpls avatar lucianpls commented on August 26, 2024

Or maybe the decoder could be changed to avoid addressing bytes outside of the written size?

from lerc.

tmaurer3 avatar tmaurer3 commented on August 26, 2024

@lucianpls Can you provide a repro case? Those sizes should be the same, otherwise it's a bug.

from lerc.

lucianpls avatar lucianpls commented on August 26, 2024

sample.zip

See attached sample. It fails to decode because the size is short one byte. I am not sure how it was created, it's one of the Esri regression samples, see https://devtopia.esri.com/ArcGISPro/RasterXI/issues/10904
I assumed it was due to the refactoring of LERC in MRF, which uses the lerc_encode() size return, as described above. The old code was using the internal API has been in use for many years previously without ever seeing this issue.

from lerc.

lucianpls avatar lucianpls commented on August 26, 2024

Well, sounds like the data in question was generated in 2016, not sure why it is failing to decode now, after the switch to the public API.
The old code (with the internal API) is here, if you want to take a look.
https://github.com/OSGeo/gdal/blame/d9b489670e6373d4931e91515897a6021a46fa4b/frmts/mrf/LERC_band.cpp

from lerc.

lucianpls avatar lucianpls commented on August 26, 2024

The test in libtiff is also suggesting that this issue does exist, see assert in line 876:

https://github.com/OSGeo/gdal/blob/master/frmts/gtiff/libtiff/tif_lerc.c

from lerc.

tmaurer3 avatar tmaurer3 commented on August 26, 2024

@lucianpls See if this branch works for you
https://github.com/Esri/lerc/tree/tmaurer3/fix_v22_decode_short_blob

from lerc.

lucianpls avatar lucianpls commented on August 26, 2024

@tmaurer3
Yes, it seems to, compiles and passes the reading test.
Can you check that I applied the patch correctly to libLERC source in GDAL, which is older? I had to merge it by hand.
lucianpls/gdal@cfdc58c

Thanks,
Lucian

from lerc.

tmaurer3 avatar tmaurer3 commented on August 26, 2024

@lucianpls Yes, looks good. Only you have this check 2x now, if (numBytes != numBytesLL). I would remove the 1st one.

from lerc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.