const lzma_filter_info *filters, bool is_encoder)
{
return lzma_simple_coder_init(next, allocator, filters,
- &arm_code, 0, 4, is_encoder);
+ &arm_code, 0, 4, 4, is_encoder);
}
const lzma_filter_info *filters, bool is_encoder)
{
return lzma_simple_coder_init(next, allocator, filters,
- &armthumb_code, 0, 4, is_encoder);
+ &armthumb_code, 0, 4, 2, is_encoder);
}
const lzma_filter_info *filters, bool is_encoder)
{
return lzma_simple_coder_init(next, allocator, filters,
- &ia64_code, 0, 16, is_encoder);
+ &ia64_code, 0, 16, 16, is_encoder);
}
const lzma_filter_info *filters, bool is_encoder)
{
return lzma_simple_coder_init(next, allocator, filters,
- &powerpc_code, 0, 4, is_encoder);
+ &powerpc_code, 0, 4, 4, is_encoder);
}
const lzma_filter_info *filters,
size_t (*filter)(lzma_simple *simple, uint32_t now_pos,
bool is_encoder, uint8_t *buffer, size_t size),
- size_t simple_size, size_t unfiltered_max, bool is_encoder)
+ size_t simple_size, size_t unfiltered_max,
+ uint32_t alignment, bool is_encoder)
{
// Allocate memory for the lzma_coder structure if needed.
if (next->coder == NULL) {
if (filters[0].options != NULL) {
const lzma_options_bcj *simple = filters[0].options;
next->coder->now_pos = simple->start_offset;
+ if (next->coder->now_pos & (alignment - 1))
+ return LZMA_OPTIONS_ERROR;
} else {
next->coder->now_pos = 0;
}
lzma_allocator *allocator, const lzma_filter_info *filters,
size_t (*filter)(lzma_simple *simple, uint32_t now_pos,
bool is_encoder, uint8_t *buffer, size_t size),
- size_t simple_size, size_t unfiltered_max, bool is_encoder);
+ size_t simple_size, size_t unfiltered_max,
+ uint32_t alignment, bool is_encoder);
#endif
const lzma_filter_info *filters, bool is_encoder)
{
return lzma_simple_coder_init(next, allocator, filters,
- &sparc_code, 0, 4, is_encoder);
+ &sparc_code, 0, 4, 4, is_encoder);
}
const lzma_filter_info *filters, bool is_encoder)
{
const lzma_ret ret = lzma_simple_coder_init(next, allocator, filters,
- &x86_code, sizeof(lzma_simple), 5, is_encoder);
+ &x86_code, sizeof(lzma_simple), 5, 1, is_encoder);
if (ret == LZMA_OK) {
next->coder->simple->prev_mask = 0;