From 3b73adfc8f4cba16524e0337df6b7d24c9e4ea2c Mon Sep 17 00:00:00 2001
From: cristy <urban-warrior@git.imagemagick.org>
Date: Sun, 11 Jan 2015 19:12:50 +0000
Subject: [PATCH] Fix a DOS for DDS file

(cherry picked from commit 9b428b7af688fe319320aed15f2b94281d1e37b4)

This is a partial fix

bug: http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=26861
bug-debian: https://bugs.debian.org/832944
origin: upstream, https://github.com/ImageMagick/ImageMagick/commit/9b428b7af688fe319320aed15f2b94281d1e37b4
---
 coders/dds.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/coders/dds.c b/coders/dds.c
index 04d792522..f1726c54b 100644
--- a/coders/dds.c
+++ b/coders/dds.c
@@ -2364,8 +2364,8 @@ static MagickBooleanType SkipDXTMipmaps(Image *image,DDSInfo *dds_info,
       for (i = 1; (i < (ssize_t) dds_info->mipmapcount) && w && h; i++)
       {
         offset = (MagickOffsetType) ((w + 3) / 4) * ((h + 3) / 4) * texel_size;
-        (void) SeekBlob(image, offset, SEEK_CUR);
-
+        if (SeekBlob(image,offset,SEEK_CUR) < 0)
+          break;
         w = DIV2(w);
         h = DIV2(h);
       }
