 static inline size_t GetPSDRowSize(Image *image)
 {
   if (image->depth == 1)
    return((image->columns+7)/8);
   else
     return(image->columns*GetPSDPacketSize(image));
 }

The product reads data past the end, or before the beginning, of the intended buffer.