summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-05-07 06:37:39 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-05-07 06:37:39 +0000
commitfe12de0fc82a50e90a9cdf978544f1caa5d94e5f (patch)
tree9ea5b7b73c0fc907a4e9120c488ef88000391bdc
parent980efa5d4d0b547b40635101414744bf463efc12 (diff)
Fix error in decompression for avhuff. Converted cubeqst CHDs
now pass verification.
-rw-r--r--src/lib/util/avhuff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/util/avhuff.c b/src/lib/util/avhuff.c
index 448a33e23fc..de8353abfb3 100644
--- a/src/lib/util/avhuff.c
+++ b/src/lib/util/avhuff.c
@@ -675,7 +675,9 @@ avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength,
if (complength < 10 + 2 * channels)
return AVHERR_INVALID_DATA;
UINT32 totalsize = 10 + 2 * channels;
- totalsize += (source[8] << 8) | source[9];
+ UINT32 treesize = (source[8] << 8) | source[9];
+ if (treesize != 0xffff)
+ totalsize += treesize;
for (int chnum = 0; chnum < channels; chnum++)
totalsize += (source[10 + 2 * chnum] << 8) | source[11 + 2 * chnum];
if (totalsize >= complength)