Skip to content

Instantly share code, notes, and snippets.

@ownclo
Created December 4, 2013 13:47
Show Gist options
  • Save ownclo/7787628 to your computer and use it in GitHub Desktop.
Save ownclo/7787628 to your computer and use it in GitHub Desktop.
diff --git a/Codec/Picture/Jpg/DefaultTable.hs b/Codec/Picture/Jpg/DefaultTable.hs
index d1ff914..4582ecd 100644
--- a/Codec/Picture/Jpg/DefaultTable.hs
+++ b/Codec/Picture/Jpg/DefaultTable.hs
@@ -75,7 +75,7 @@ packHuffmanTree tree = runST $ do
aux (Branch i1 i2@(Leaf _)) idx = do
ix1 <- aux i1 (idx + 2)
_ <- aux i2 (idx + 1)
- (table `M.unsafeWrite` idx) (fromIntegral ix1)
+ (table `M.unsafeWrite` idx) (fromIntegral $ idx + 2)
return ix1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment