Andrew Johnson
Andrew Johnson

Reputation: 13286

What happens to a piece of data if you use zlib to decompress it, but it isn't compressed in the first place?

If you decompress data with zlib that isn't compressed, does anything happen?

If it does in fact change the data, how do you check if data is zlib zipped in the first place?

Upvotes: 1

Views: 294

Answers (1)

zanlok
zanlok

Reputation: 1630

There would need to be a valid header. Extremely unlikely that this could ever happen unless it was an accurately structured (compressed) data stream, so it would be invalid data to inflate.

Upvotes: 5

Related Questions