VirtualBox

source: vbox/trunk/src/libs/liblzma-5.8.1/simple/simple_decoder.c@ 109302

Last change on this file since 109302 was 108913, checked in by vboxsync, 6 weeks ago

libs/liblzma: Liblzma ose fix. jiraref:VBP-1635

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 913 bytes
Line 
1// SPDX-License-Identifier: 0BSD
2
3///////////////////////////////////////////////////////////////////////////////
4//
5/// \file simple_decoder.c
6/// \brief Properties decoder for simple filters
7//
8// Author: Lasse Collin
9//
10///////////////////////////////////////////////////////////////////////////////
11
12#include "simple_decoder.h"
13
14
15extern lzma_ret
16lzma_simple_props_decode(void **options, const lzma_allocator *allocator,
17 const uint8_t *props, size_t props_size)
18{
19 if (props_size == 0)
20 return LZMA_OK;
21
22 if (props_size != 4)
23 return LZMA_OPTIONS_ERROR;
24
25 lzma_options_bcj *opt = lzma_alloc(
26 sizeof(lzma_options_bcj), allocator);
27 if (opt == NULL)
28 return LZMA_MEM_ERROR;
29
30 opt->start_offset = read32le(props);
31
32 // Don't leave an options structure allocated if start_offset is zero.
33 if (opt->start_offset == 0)
34 lzma_free(opt, allocator);
35 else
36 *options = opt;
37
38 return LZMA_OK;
39}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette