From 38fb2aaffb2013478c6a48c7264ab0b8095485fe Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 13 Feb 2018 07:02:03 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6269 --- coders/dcm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)) -- 2.40.0