From: Cristy Date: Tue, 13 Feb 2018 12:02:03 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6269 X-Git-Tag: 7.0.7-23~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38fb2aaffb2013478c6a48c7264ab0b8095485fe;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6269 --- diff --git a/coders/dcm.c b/coders/dcm.c index 3e8fd15dc..a1a0a8953 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3816,7 +3816,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) unsigned int tag; - tag=(ReadBlobLSBShort(image) << 16) | ReadBlobLSBShort(image); + tag=((unsigned int) ReadBlobLSBShort(image) << 16) | + ReadBlobLSBShort(image); length=(size_t) ReadBlobLSBLong(image); if (tag == 0xFFFEE0DD) break; /* sequence delimiter tag */ @@ -3911,7 +3912,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (c == EOF) break; } - tag=(ReadBlobLSBShort(image) << 16) | ReadBlobLSBShort(image); + tag=((unsigned int) ReadBlobLSBShort(image) << 16) | + ReadBlobLSBShort(image); (void) tag; length=(size_t) ReadBlobLSBLong(image); if (length > GetBlobSize(image)) @@ -4016,7 +4018,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (c == EOF) break; } - tag=(ReadBlobLSBShort(image) << 16) | ReadBlobLSBShort(image); + tag=((unsigned int) ReadBlobLSBShort(image) << 16) | + ReadBlobLSBShort(image); stream_info->remaining=(size_t) ReadBlobLSBLong(image); if ((tag != 0xFFFEE000) || (stream_info->remaining <= 64) || (EOFBlob(image) != MagickFalse))