diff --git a/src/zlib/infback.c b/src/zlib/infback.c index 110b03b857..e9709984a8 100644 --- a/src/zlib/infback.c +++ b/src/zlib/infback.c @@ -434,6 +434,9 @@ void FAR *out_desc; } } + if (state->mode == BAD) + break; + /* build code tables */ state->next = state->codes; state->lencode = (code const FAR *)(state->next); diff --git a/src/zlib/inflate.c b/src/zlib/inflate.c index a53b5c7446..be67fd6920 100644 --- a/src/zlib/inflate.c +++ b/src/zlib/inflate.c @@ -861,6 +861,9 @@ int flush; } } + if (state->mode == BAD) + break; + /* build code tables */ state->next = state->codes; state->lencode = (code const FAR *)(state->next);