pdfzlibinflate

Data error when inflating the zlib stream object


I am trying to inflate an object stream in a pdf. While inflating one of the object stream which is compressed with flate decode I am getting data error.

Object stream 1339 0 obj^M<</First 7/Length 36/Filter/FlateDecode/N 1/Type/ObjStm>>stream^M

^ZÖ¬Áã9^<87>^GÎ<89><93>^WÊ<8d>ð<93>yM<96>t0Ò=$Ô<·×^L<84>°¯$<8b>^M endstream

**Encryption object ** 1698 0 obj^M<</Length 128/Filter/Standard/O(¡"ÎÙ¢¬<9d><9c>­"\r^S^LÀõeâJý;Î{dTÔÜ<9d>~´>^Tº)/P -1324/R 3/U(É^[®ú^F^C /¬®=ÌæZv5');\r\n view( a)/V 2>>^Mendobj

After decrypting I got this data {0x68, 0x16, 0x48, 0x59, 0x11, 0xef, 0x34, 0xe9, 0xd0, 0x79, 0xf6, 0xcb, 0x73, 0xf6, 0x8a, 0x50, 0xed, 0xdc, 0x34, 0xe9, 0x60, 0xb1, 0xbf, 0x3, 0xf5, 0x92, 0x5, 0x67, 0x60, 0xd9, 0x84, 0x34, 0x44, 0xad, 0xa9, 0x5c} Now I have to uncompress this data.

I am getting data error after calling inflate(&zstrm, Z_FINISH); I am stuck here. Can anyone please help me to understand this error.

Ans :

Here the input I was supplying to zlib was not a valid inflate data. When the input stream was encrypted the first character was new line character. I was skipping that newline character. That was the error.


Solution

  • That's not a zlib stream, nor is it even raw deflate data.