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

Side by Side Diff: xz/src/liblzma/common/filter_flags_decoder.c

Issue 2869016: Add an unpatched version of xz, XZ Utils, to /trunk/deps/third_party (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « xz/src/liblzma/common/filter_encoder.c ('k') | xz/src/liblzma/common/filter_flags_encoder.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file filter_flags_decoder.c
4 /// \brief Decodes a Filter Flags field
5 //
6 // Author: Lasse Collin
7 //
8 // This file has been put into the public domain.
9 // You can do whatever you want with this file.
10 //
11 ///////////////////////////////////////////////////////////////////////////////
12
13 #include "filter_decoder.h"
14
15
16 extern LZMA_API(lzma_ret)
17 lzma_filter_flags_decode(
18 lzma_filter *filter, lzma_allocator *allocator,
19 const uint8_t *in, size_t *in_pos, size_t in_size)
20 {
21 // Set the pointer to NULL so the caller can always safely free it.
22 filter->options = NULL;
23
24 // Filter ID
25 return_if_error(lzma_vli_decode(&filter->id, NULL,
26 in, in_pos, in_size));
27
28 if (filter->id >= LZMA_FILTER_RESERVED_START)
29 return LZMA_DATA_ERROR;
30
31 // Size of Properties
32 lzma_vli props_size;
33 return_if_error(lzma_vli_decode(&props_size, NULL,
34 in, in_pos, in_size));
35
36 // Filter Properties
37 if (in_size - *in_pos < props_size)
38 return LZMA_DATA_ERROR;
39
40 const lzma_ret ret = lzma_properties_decode(
41 filter, allocator, in + *in_pos, props_size);
42
43 *in_pos += props_size;
44
45 return ret;
46 }
OLDNEW
« no previous file with comments | « xz/src/liblzma/common/filter_encoder.c ('k') | xz/src/liblzma/common/filter_flags_encoder.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698