From 751b4eba25aa2e2a31232c9c25ceb6dbddfb1d93 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Thu, 9 Jun 2016 14:07:50 -0700 Subject: Fix possible out of bounds access Bug: 28868315 Change-Id: I2b416c662f9ad7f9b3c6cf973a39c6693c66775a --- exif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exif.c b/exif.c index bb01453..2c89293 100644 --- a/exif.c +++ b/exif.c @@ -614,7 +614,7 @@ static void ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned OffsetVal; OffsetVal = Get32u(DirEntry+8); // If its bigger than 4 bytes, the dir entry contains an offset. - if (OffsetVal+ByteCount > ExifLength){ + if (OffsetVal > UINT32_MAX - ByteCount || OffsetVal+ByteCount > ExifLength){ // Bogus pointer offset and / or bytecount value ErrNonfatal("Illegal value pointer for tag %04x", Tag,0); continue; -- cgit v1.2.3