oh, better! it does check the value properly, but only the width. height can be negative.
and oh my gosh @mothcompute was right. if I set the values to 0x20000000, 0xe0ffffff (32 x -32) then we get a flipped image, where the top of the file ACTUALLY is the top of the file!!
… at least in GIMP and firefox. feh just ignores it