Code:  static inline const unsigned char *ReadResourceShort(const unsigned char *p,
   unsigned short *quantum)
 {
  *quantum=(unsigned short) (*p++ << 8);
  *quantum|=(unsigned short) (*p++ << 0);
   return(p);
}static inline void WriteResourceLong(unsigned char *p,

Commit Message: Improve checking of EXIF profile to prevent integer overflow (bug report from Ibrahim el-sayed)
CWE ID: CWE-125
 static inline const unsigned char *ReadResourceShort(const unsigned char *p,
   unsigned short *quantum)
 {
  *quantum=(unsigned short) (*p++) << 8;
  *quantum|=(unsigned short) (*p++);
   return(p);
