• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OSGeo / gdal / 20303526321

17 Dec 2025 12:55PM UTC coverage: 71.354% (-0.01%) from 71.365%
20303526321

push

github

rouault
BMP: fix RLE4 encoded mode

There was a subtle bug in the RLE4 decoder for encoded mode alternating
value runs. In the first pixel value of the alternating run depended on
whether the length of the run is odd or even. So `05 12` was decoded to
`1 2 1 2 1` (correct) and `06 12` was (incorrectly) decoded to `2 1 2 1 2 1`.
This change almost matches the decoding of absolute mode a few lines
below.

This bug was found and the fix verified by comparing a GeoTIFF created
by gdal_translate directly from a RLE4 compressed BMP with a
GeoTIFF created by gdal_translate from a PNG converted with ImageMagick
from the RLE4 BMP file.

A test file in RLE4 format has been added generated from 4bit_pal.bmp.
This test verifies the fix in this commit.

4 of 4 new or added lines in 1 file covered. (100.0%)

180 existing lines in 50 files now uncovered.

591784 of 829368 relevant lines covered (71.35%)

296348.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.72
/alg/gdalgrid.cpp


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc