1 ///////////////////////////////////////////////////////////////////////////////
3 /// \file simple_decoder.c
4 /// \brief Properties decoder for simple filters
6 // Copyright (C) 2007-2008 Lasse Collin
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
18 ///////////////////////////////////////////////////////////////////////////////
20 #include "simple_decoder.h"
24 lzma_simple_props_decode(void **options, lzma_allocator *allocator,
25 const uint8_t *props, size_t props_size)
31 return LZMA_OPTIONS_ERROR;
33 lzma_options_simple *opt = lzma_alloc(
34 sizeof(lzma_options_simple), allocator);
36 return LZMA_MEM_ERROR;
38 opt->start_offset = integer_read_32(props);
40 // Don't leave an options structure allocated if start_offset is zero.
41 if (opt->start_offset == 0)
42 lzma_free(opt, allocator);