VirtualBox

source: vbox/trunk/src/libs/liblzma-5.4.1/simple/simple_decoder.c@ 103304

最後變更 在這個檔案從103304是 98730,由 vboxsync 提交於 2 年 前

libs/liblzma-5.4.1: Export to OSE, bugref:10254

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 982 位元組
 
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
16extern lzma_ret
17lzma_simple_props_decode(void **options, const 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 = 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}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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