changeset 1078:a3ef48c7e9d3

Check for end of input data, there might be no "final" bit set in the stream.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 02 Mar 2015 04:47:27 +0200
parents 7bf421248190
children 47c0514d9ba4
files src/dmzlib.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/dmzlib.c	Mon Mar 02 04:47:03 2015 +0200
+++ b/src/dmzlib.c	Mon Mar 02 04:47:27 2015 +0200
@@ -556,6 +556,9 @@
     ctx->codeBuffer = 0;
     do
     {
+        if (ctx->inBuffer == ctx->inBufferEnd)
+            break;
+
         final = dmZReceive(ctx, 1);
         type  = dmZReceive(ctx, 2);
         if (type == 0)