|
Line
Link Here
|
| 0 |
-- libclamunrar/unrarvm.c.orig |
0 |
++ libclamunrar/unrarvm.c |
|
Lines 26-31
Link Here
|
| 26 |
#include "libclamunrar/unrarvm.h" |
26 |
#include "libclamunrar/unrarvm.h" |
| 27 |
#include "libclamunrar/unrarcmd.h" |
27 |
#include "libclamunrar/unrarcmd.h" |
| 28 |
|
28 |
|
|
|
29 |
/* |
| 30 |
* Limit maximum number of channels in RAR3 delta filter to some |
| 31 |
* reasonable value to prevent too slow processing of corrupt archives |
| 32 |
* with invalid channels number. |
| 33 |
*/ |
| 34 |
#define MAX3_UNPACK_CHANNELS 1024 |
| 35 |
|
| 29 |
#ifdef RAR_HIGH_DEBUG |
36 |
#ifdef RAR_HIGH_DEBUG |
| 30 |
#define rar_dbgmsg printf |
37 |
#define rar_dbgmsg printf |
| 31 |
#else |
38 |
#else |
|
Lines 340-347
static void filter_itanium_setbits(unsig
Link Here
|
| 340 |
static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_filters_t filter_type) |
347 |
static void execute_standard_filter(rarvm_data_t *rarvm_data, rarvm_standard_filters_t filter_type) |
| 341 |
{ |
348 |
{ |
| 342 |
unsigned char *data, cmp_byte2, cur_byte, *src_data, *dest_data; |
349 |
unsigned char *data, cmp_byte2, cur_byte, *src_data, *dest_data; |
| 343 |
int i, j, data_size, channels, src_pos, dest_pos, border, width, PosR; |
350 |
int i, j, op_type, cur_channel, byte_count, start_pos, pa, pb, pc; |
| 344 |
int op_type, cur_channel, byte_count, start_pos, pa, pb, pc; |
351 |
unsigned int data_size, channels, src_pos, dest_pos, border, width, PosR; |
| 345 |
unsigned int file_offset, cur_pos, predicted; |
352 |
unsigned int file_offset, cur_pos, predicted; |
| 346 |
int32_t offset, addr; |
353 |
int32_t offset, addr; |
| 347 |
const int file_size=0x1000000; |
354 |
const int file_size=0x1000000; |
|
Lines 426-432
static void execute_standard_filter(rarv
Link Here
|
| 426 |
border = data_size*2; |
433 |
border = data_size*2; |
| 427 |
|
434 |
|
| 428 |
SET_VALUE(FALSE, &rarvm_data->mem[VM_GLOBALMEMADDR+0x20], data_size); |
435 |
SET_VALUE(FALSE, &rarvm_data->mem[VM_GLOBALMEMADDR+0x20], data_size); |
| 429 |
if ((unsigned int)data_size >= VM_GLOBALMEMADDR/2) { |
436 |
if ((unsigned int)data_size >= VM_GLOBALMEMADDR/2 || channels > MAX3_UNPACK_CHANNELS) { |
| 430 |
break; |
437 |
break; |
| 431 |
} |
438 |
} |
| 432 |
for (cur_channel=0 ; cur_channel < channels ; cur_channel++) { |
439 |
for (cur_channel=0 ; cur_channel < channels ; cur_channel++) { |