Fix hIST chunk position to match W3C specification The hIST chunk was incorrectly positioned in the code. According to the W3C specification, the hIST chunk must appear before the first IDAT chunk and after PLTE (if present). This commit corrects the chunk positioning to comply with the specification.
diff --git a/pngrutil.c b/pngrutil.c index c05fa1c..39567b8 100644 --- a/pngrutil.c +++ b/pngrutil.c
@@ -3259,7 +3259,7 @@ # define CDiTXt NoCheck, 6U, 0, hIHDR, 1 /* Allocates 'length+1'; checked in the handler */ # define CDbKGD 6U, 1U, hIDAT, hIHDR, 0 -# define CDhIST 1024U, 0U, hPLTE, hIHDR, 0 +# define CDhIST 1024U, 0U, hIDAT, hPLTE, 0 # define CDpHYs 9U, 9U, hIDAT, hIHDR, 0 # define CDsPLT NoCheck, 3U, hIDAT, hIHDR, 1 /* Allocates 'length+1'; checked in the handler */