diff --git a/Codec/Picture/Jpg.hs b/Codec/Picture/Jpg.hs
--- a/Codec/Picture/Jpg.hs
+++ b/Codec/Picture/Jpg.hs
@@ -327,7 +327,7 @@
             where v = str `L.index` n
                   vNext = str `L.index` (n + 1)
                   isReset = 0xD0 <= vNext && vNext <= 0xD7
-                 
+
 parseFrames :: Get [JpgFrame]
 parseFrames = do
     kind <- get
@@ -987,8 +987,9 @@
             comp compIdx ((horizCount, vertCount, dcTree, acTree, qTable, unpack):comp_rest) = liner 0
               where liner yd | yd >= vertCount = comp (compIdx + 1) comp_rest
                     liner yd = columner 0
-                      where columner xd | xd >= horizCount = liner (yd + 1)
-                            columner xd | (xd == horizCount - 1 && x == horizontalBlockCount - 1) || yd == horizCount - 1 = do
+                      where verticalLimited = yd == horizCount - 1 || y == verticalBlockCount - 1
+                            columner xd | xd >= horizCount = liner (yd + 1)
+                            columner xd | (xd == horizCount - 1 && x == horizontalBlockCount - 1) || verticalLimited = do
                                 dc <- lift $ dcArray `M.unsafeRead` compIdx
                                 (dcCoeff, block) <-
                                     decompressMacroBlock dcTree acTree qTable zigZagArray $ fromIntegral dc
diff --git a/JuicyPixels.cabal b/JuicyPixels.cabal
--- a/JuicyPixels.cabal
+++ b/JuicyPixels.cabal
@@ -1,10 +1,10 @@
 Name:                JuicyPixels
-Version:             3.1.1
+Version:             3.1.1.1
 Synopsis:            Picture loading/serialization (in png, jpeg, bitmap, gif, tiff and radiance)
 Description:
     <<data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADABAMAAACg8nE0AAAAElBMVEUAAABJqDSTWEL/qyb///8AAABH/1GTAAAAAXRSTlMAQObYZgAAAN5JREFUeF7s1sEJgFAQxFBbsAV72v5bEVYWPwT/XDxmCsi7zvHXavYREBDI3XP2GgICqBBYuwIC+/rVayPUAyAg0HvIXBcQoDFDGnUBgWQQ2Bx3AYFaRoBpAQHWb3bt2ARgGAiCYFFuwf3X5HA/McgGJWI2FdykCv4aBYzmKwDwvl6NVmUAAK2vlwEALK7fo88GANB6HQsAAAAAAAAA7P94AQCzswEAAAAAAAAAAAAAAAAAAICzh4UAO4zWAYBfRutHA4Bn5C69JhowAMGoBaMWDG0wCkbBKBgFo2AUAACPmegUST/IJAAAAABJRU5ErkJggg==>>
     .
-    This library can load and store images in PNG,Bitmap, Jpeg, Radiance and read Gif  and Tiff images.
+    This library can load and store images in PNG,Bitmap, Jpeg, Radiance, Tiff and read Gif images.
 
 homepage:            https://github.com/Twinside/Juicy.Pixels
 License:             BSD3
@@ -24,7 +24,7 @@
 Source-Repository this
     Type:      git
     Location:  git://github.com/Twinside/Juicy.Pixels.git
-    Tag:       v3.1.1
+    Tag:       v3.1.1.1
 
 Flag Mmap
     Description: Enable the file loading via mmap (memory map)
