Comments (8)
Or maybe the decoder could be changed to avoid addressing bytes outside of the written size?
from lerc.
@lucianpls Can you provide a repro case? Those sizes should be the same, otherwise it's a bug.
from lerc.
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.
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.
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.
@lucianpls See if this branch works for you
https://github.com/Esri/lerc/tree/tmaurer3/fix_v22_decode_short_blob
from lerc.
@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.
@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)
- Doc question: How does compression work for lossless MaxZError = 0? HOT 2
- Cannot build static library (typo in Makefile) HOT 3
- unpkg.com redirect doesn't handle wasm HOT 1
- Typescript export interfaces HOT 2
- Support for big-endian architectures HOT 2
- calling Python timer() when printInfo is false
- BitStuffer2::BitStuff undefined bitshift HOT 3
- std::greater
- std::min
- Homebrew GDAL HOT 4
- Typos
- Update on PyPI HOT 2
- Problem with PyPi package pushed out 2023-03-15 10:36:12 UTC HOT 2
- A different implementation for CāÆ HOT 2
- JS example not working?! HOT 4
- JS encode support HOT 1
- Rename lerc python package to pylerc
- JS and C# binding no encode function HOT 1
- Failed to build with GCC 13 since commit 5625edec7bb HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lerc.