Right, and what is read supposed to return on error? Returning 0 caused me access violation, returning -1 like in all others works and just errors with sane message about file being corrupt. Also maybe it's a good idea to make more apparent that read assumes that read pointer is advanced by the amount of bytes read, maybe I'm stupid but that wasn't that obvious to me. And assumption(or maybe I debugged my stream wrong but I didn't see a single seek() call in my test for sf::Image from png) that streams start with read pointer at 0 can be somewhat harmful if I'd want to load few things from same stream in succession, I'd have to call seek(0) myself in between or it'd error out with corrupt file message.