Catch overflow when incrementing dst pointer.
diff --git a/decode.go b/decode.go
index 011033c..0ac8e4f 100644
--- a/decode.go
+++ b/decode.go
@@ -121,11 +121,10 @@
 			return nil, errUnsupportedCopy4Tag
 		}
 
-		end := d + length
-		if offset > d || end > len(dst) {
+		if offset > d || length > len(dst)-d {
 			return nil, ErrCorrupt
 		}
-		for ; d < end; d++ {
+		for end := d + length; d != end; d++ {
 			dst[d] = dst[d-offset]
 		}
 	}