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

Side by Side Diff: xz/src/liblzma/simple/simple_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/simple/simple_decoder.h ('k') | xz/src/liblzma/simple/simple_encoder.h » ('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 simple_decoder.c
4 /// \brief Properties decoder for simple filters
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 "simple_decoder.h"
14
15
16 extern lzma_ret
17 lzma_simple_props_decode(void **options, lzma_allocator *allocator,
18 const uint8_t *props, size_t props_size)
19 {
20 if (props_size == 0)
21 return LZMA_OK;
22
23 if (props_size != 4)
24 return LZMA_OPTIONS_ERROR;
25
26 lzma_options_bcj *opt = lzma_alloc(
27 sizeof(lzma_options_bcj), allocator);
28 if (opt == NULL)
29 return LZMA_MEM_ERROR;
30
31 opt->start_offset = unaligned_read32le(props);
32
33 // Don't leave an options structure allocated if start_offset is zero.
34 if (opt->start_offset == 0)
35 lzma_free(opt, allocator);
36 else
37 *options = opt;
38
39 return LZMA_OK;
40 }
OLDNEW
« no previous file with comments | « xz/src/liblzma/simple/simple_decoder.h ('k') | xz/src/liblzma/simple/simple_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698