 		{
 			data.position = 0;
 			var uncompressed:ByteArray = new ByteArray();
+			var chunk:ByteArray = new ByteArray();
 			var outBytesLength:int = data.length * 2;
 			
 			var err:int;

						// unknown error
						if (err != JZlib.Z_OK)
						{
							if (stream.msg == null) {
								trace("Unknown error. Error code : " + err);
							}
							else {
								trace("Unknown error. Error code : " + err + " and message : " + stream.msg);
							}
						}
				}
				
				outcount++;
				//trace("Zlib.uncompress. outcount: " + outcount + ", stream.total_out: " + stream.total_out);

				if (!checkError(stream, err, "inflate"))
				{
					break;

						trace("Zlib.uncompress. inflation stream ended");
						break;
					case JZlib.Z_BUF_ERROR:
						emptyByteArrayIntoByteArray(chunk, uncompressed);
						stream.next_out_index = 0;
						stream.avail_out = outBytesLength;
						break;
