Skip to content

Commit 96777bd

Browse files
marconeandi34
authored andcommitted
Fix possible out of bounds access
Bug: 28868315 Change-Id: I2b416c662f9ad7f9b3c6cf973a39c6693c66775a (cherry picked from commit 751b4eba25aa2e2a31232c9c25ceb6dbddfb1d93)
1 parent acbfc9c commit 96777bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ static void ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase,
614614
unsigned OffsetVal;
615615
OffsetVal = Get32u(DirEntry+8);
616616
// If its bigger than 4 bytes, the dir entry contains an offset.
617-
if (OffsetVal+ByteCount > ExifLength){
617+
if (OffsetVal > UINT32_MAX - ByteCount || OffsetVal+ByteCount > ExifLength){
618618
// Bogus pointer offset and / or bytecount value
619619
ErrNonfatal("Illegal value pointer for tag %04x", Tag,0);
620620
continue;

0 commit comments

Comments
 (0)