@@ -430,7 +430,9 @@ getLazyByteString n = do
430430-- | Test whether all input has been consumed, i.e. there are no remaining
431431-- undecoded bytes.
432432isEmpty :: BitGet Bool
433−isEmpty = B $ \ (S bs o) -> B.isEmpty >>= \e -> return (S bs o, e)
433+isEmpty = B $ \ (S bs o) -> if B.null bs
434+ then B.isEmpty >>= \e -> return (S bs o, e)
435+ else return (S bs o, False)
434436
435437-- | Read a 1 bit 'Bool'.
436438bool :: Block Bool