| 106 | |
| 107 | |
| 108 | void RarVM::SetMemory(size_t Pos,byte *Data,size_t DataSize) |
| 109 | { |
| 110 | if (Pos<VM_MEMSIZE && Data!=Mem+Pos) |
| 111 | { |
| 112 | // We can have NULL Data for invalid filters with DataSize==0. While most |
| 113 | // sensible memmove implementations do not care about data if size is 0, |
| 114 | // let's follow the standard and check the size first. |
| 115 | size_t CopySize=Min(DataSize,VM_MEMSIZE-Pos); |
| 116 | if (CopySize!=0) |
| 117 | memmove(Mem+Pos,Data,CopySize); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | |
| 122 | bool RarVM::ExecuteStandardFilter(VM_StandardFilters FilterType) |