Don't abort the game if encounter an invalid huffman code in fast decode loop

This commit is contained in:
UnknownShadow200 2020-12-17 18:28:44 +11:00
parent 71d7abe337
commit 3e2004c5ee

View File

@ -328,8 +328,12 @@ static int Huffman_UNSAFE_Decode_Slow(struct InflateState* state, struct Huffman
} }
} }
Logger_Abort("DEFLATE - Invalid huffman code"); Inflate_Fail(state, INF_ERR_INVALID_CODE);
return -1; /* Need to exit the fast decode loop */
/* TODO: This means a few garbage bytes can get written */
/* to the output, but it probably doesn't matter */
state->AvailIn = 0;
return 0;
} }
void Inflate_Init2(struct InflateState* state, struct Stream* source) { void Inflate_Init2(struct InflateState* state, struct Stream* source) {