Add some missing state transitions to DecodeContextMap().

Update the states in DecodeContextMap to the next one,
else it would continue at the wrong spot if exactly there
the partial input is split.
This commit is contained in:
Zoltan Szabadka 2015-03-30 13:39:20 +02:00
parent 44ca0e2cbe
commit 8f3092a0b1

View File

@ -464,11 +464,13 @@ static BrotliResult DecodeContextMap(int context_map_size,
if (s->context_map_table == NULL) {
return BROTLI_RESULT_ERROR;
}
s->sub_state[0] = BROTLI_STATE_SUB_CONTEXT_MAP_HUFFMAN;
/* No break, continue to next state. */
case BROTLI_STATE_SUB_CONTEXT_MAP_HUFFMAN:
result = ReadHuffmanCode(
*num_htrees + max_run_length_prefix, s->context_map_table, NULL, s);
if (result != BROTLI_RESULT_SUCCESS) return result;
s->sub_state[0] = BROTLI_STATE_SUB_CONTEXT_MAPS;
/* No break, continue to next state. */
case BROTLI_STATE_SUB_CONTEXT_MAPS:
while (s->context_index < context_map_size) {