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

Side by Side Diff: src/liblzma/common/auto_decoder.c

Issue 62403002: Update XZ Utils to 5.0.5 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/xz/
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/liblzma/common/alone_decoder.c ('k') | src/lzmainfo/lzmainfo.1 » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /////////////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////////////////////////
2 // 2 //
3 /// \file auto_decoder.c 3 /// \file auto_decoder.c
4 /// \brief Autodetect between .xz Stream and .lzma (LZMA_Alone) formats 4 /// \brief Autodetect between .xz Stream and .lzma (LZMA_Alone) formats
5 // 5 //
6 // Author: Lasse Collin 6 // Author: Lasse Collin
7 // 7 //
8 // This file has been put into the public domain. 8 // This file has been put into the public domain.
9 // You can do whatever you want with this file. 9 // You can do whatever you want with this file.
10 // 10 //
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // Detect the file format. For now this is simple, since if 47 // Detect the file format. For now this is simple, since if
48 // it doesn't start with 0xFD (the first magic byte of the 48 // it doesn't start with 0xFD (the first magic byte of the
49 // new format), it has to be LZMA_Alone, or something that 49 // new format), it has to be LZMA_Alone, or something that
50 // we don't support at all. 50 // we don't support at all.
51 if (in[*in_pos] == 0xFD) { 51 if (in[*in_pos] == 0xFD) {
52 return_if_error(lzma_stream_decoder_init( 52 return_if_error(lzma_stream_decoder_init(
53 &coder->next, allocator, 53 &coder->next, allocator,
54 coder->memlimit, coder->flags)); 54 coder->memlimit, coder->flags));
55 } else { 55 } else {
56 return_if_error(lzma_alone_decoder_init(&coder->next, 56 return_if_error(lzma_alone_decoder_init(&coder->next,
57 » » » » » allocator, coder->memlimit)); 57 » » » » » allocator, coder->memlimit, true));
58 58
59 // If the application wants to know about missing 59 // If the application wants to know about missing
60 // integrity check or about the check in general, we 60 // integrity check or about the check in general, we
61 // need to handle it here, because LZMA_Alone decoder 61 // need to handle it here, because LZMA_Alone decoder
62 // doesn't accept any flags. 62 // doesn't accept any flags.
63 if (coder->flags & LZMA_TELL_NO_CHECK) 63 if (coder->flags & LZMA_TELL_NO_CHECK)
64 return LZMA_NO_CHECK; 64 return LZMA_NO_CHECK;
65 65
66 if (coder->flags & LZMA_TELL_ANY_CHECK) 66 if (coder->flags & LZMA_TELL_ANY_CHECK)
67 return LZMA_GET_CHECK; 67 return LZMA_GET_CHECK;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 extern LZMA_API(lzma_ret) 177 extern LZMA_API(lzma_ret)
178 lzma_auto_decoder(lzma_stream *strm, uint64_t memlimit, uint32_t flags) 178 lzma_auto_decoder(lzma_stream *strm, uint64_t memlimit, uint32_t flags)
179 { 179 {
180 lzma_next_strm_init(auto_decoder_init, strm, memlimit, flags); 180 lzma_next_strm_init(auto_decoder_init, strm, memlimit, flags);
181 181
182 strm->internal->supported_actions[LZMA_RUN] = true; 182 strm->internal->supported_actions[LZMA_RUN] = true;
183 strm->internal->supported_actions[LZMA_FINISH] = true; 183 strm->internal->supported_actions[LZMA_FINISH] = true;
184 184
185 return LZMA_OK; 185 return LZMA_OK;
186 } 186 }
OLDNEW
« no previous file with comments | « src/liblzma/common/alone_decoder.c ('k') | src/lzmainfo/lzmainfo.1 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698