Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(925)

Unified Diff: doc/examples_old/xz_pipe_decomp.c

Issue 12568011: Update XZ Utils to 5.0.4 (third_party) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/xz/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: doc/examples_old/xz_pipe_decomp.c
===================================================================
--- doc/examples_old/xz_pipe_decomp.c (revision 0)
+++ doc/examples_old/xz_pipe_decomp.c (working copy)
@@ -1,7 +1,7 @@
/*
* xz_pipe_decomp.c
* A simple example of pipe-only xz decompressor implementation.
- * version: 2010-07-12 - by Daniel Mealha Cabrita
+ * version: 2012-06-14 - by Daniel Mealha Cabrita
* Not copyrighted -- provided to the public domain.
*
* Compiling:
@@ -101,6 +101,14 @@
} while (strm.avail_out == 0);
}
+ /* Bug fix (2012-06-14): If no errors were detected, check
+ that the last lzma_code() call returned LZMA_STREAM_END.
+ If not, the file is probably truncated. */
+ if ((ret == RET_OK) && (ret_xz != LZMA_STREAM_END)) {
+ fprintf (stderr, "Input truncated or corrupt\n");
+ ret = RET_ERROR_DECOMPRESSION;
+ }
+
lzma_end (&strm);
return ret;
}
« README.chromium ('K') | « doc/examples_old/xz_pipe_comp.c ('k') | doc/faq.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698