[bug #62125] Error on read (some) 4-bit PNG images

2022-04-27 Thread Pat L
Follow-up Comment #1, bug #62125 (project grub):

Just for the record, "pnmtopng -force" creates (non-paletted) PNG files that
avoid this issue.


___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #62125] Error on read (some) 4-bit PNG images

2022-02-28 Thread Patrick J. LoPresti
URL:
  

 Summary: Error on read (some) 4-bit PNG images
 Project: GNU GRUB
Submitted by: patl1729
Submitted on: Mon 28 Feb 2022 05:35:26 PM UTC
Category: Terminal
Severity: Major
Priority: 5 - Normal
  Item Group: None
  Status: None
 Privacy: Public
 Assigned to: None
 Originator Name: 
Originator Email: 
 Open/Closed: Open
 Release: 
 Release: 2.02
 Discussion Lock: Any
 Reproducibility: None
 Planned Release: None

___

Details:

The attached PNG file is valid. It was generated by "pnmtopng"; it loads in
every viewer I have tried; and it passes "pngcheck".

But when I try to load it from GRUB (UEFI boot) using "background_image", I
get this error:


  error: ../../grub-core/video/readers/png.c:595 invalid filter value


Note that this image's depth is 4 bits (with a palette):


$ pngcheck -v logo-save.png  | head -3
File: logo-save.png (594 bytes)
  chunk IHDR at offset 0xc, length 13
640 x 480 image, 4-bit palette, non-interlaced


When I modify this image to add more colors, making the depth 8 bits, GRUB can
load the modified image without any trouble.

Possibly related, the validation check at png.c line 286:

https://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/video/readers/png.c?h=grub-2.02#n286

...specifically allows a 4-bit image depth. (Separate bug: The error message
on line 290 does not match the check.)

I believe others have encountered the same bug; see e.g.
https://bugs.mageia.org/show_bug.cgi?id=28225



___

File Attachments:


---
Date: Mon 28 Feb 2022 05:35:26 PM UTC  Name: logo.png  Size: 594B   By:
patl1729



___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/