]> granicus.if.org Git - xz/commitdiff
Fixed Stream decoder to actually use the first_stream variable.
authorLasse Collin <lasse.collin@tukaani.org>
Tue, 30 Sep 2008 10:57:44 +0000 (13:57 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 30 Sep 2008 10:57:44 +0000 (13:57 +0300)
src/liblzma/common/stream_decoder.c

index ab5f2afd213acf12322dc7396fc18636667793d0..e137685ffbbda72cfd7e577e299e251bf3f1434b 100644 (file)
@@ -128,6 +128,11 @@ stream_decode(lzma_coder *coder, lzma_allocator *allocator,
                        return ret == LZMA_FORMAT_ERROR && !coder->first_stream
                                        ? LZMA_DATA_ERROR : ret;
 
+               // If we are decoding concatenated Streams, and the later
+               // Streams have invalid Header Magic Bytes, we give
+               // LZMA_DATA_ERROR instead of LZMA_FORMAT_ERROR.
+               coder->first_stream = false;
+
                // Copy the type of the Check so that Block Header and Block
                // decoders see it.
                coder->block_options.check = coder->stream_flags.check;