Yeah, the decoder is probably buggy, but here is what's strange though - if I have a standard simple image in .png without an associated profile (should be sRGB profile by default then, right?) and save if into .avif using your plugin, it gets a new profile attached, and then probably Win Paint just ignores it and when I open both - original .png and the exported one in Win Paint, the contrast difference looks like day and night. I remember I saw a similar issue when used GIMP to export to .avif, but it wasn't happening when used a command line tool (forgot its name) instead. So, it's something about No profile -> saved with some added profile -> opened in a viewer that doesn't care about the attached profile. I understand it's more like an issue with the viewer, but what I don't understand - if the original image didn't have a color profile or had some specific one, why would it change at all after exporting to .avif?
Another thought about it - when I was re-encoding videos from my old GoPro I also noticed issues with contrast differences, and I think the reason there was a specific color space that didn't use levels below some (16 I think?) and above some (235 or something like that), so it wasn't like full RGB. It's nothing to do with .avif (I was re-encoding that to h265 I think), but the root cause can be similar. When I save my lossless .png to very high quality .avif's, I want to be sure that it preserves the original color profile/space (or lack of it) and doesn't cut/stretch any levels.