summaryrefslogtreecommitdiff
path: root/xdelta3/xdelta3-decode.h
diff options
context:
space:
mode:
Diffstat (limited to 'xdelta3/xdelta3-decode.h')
-rw-r--r--xdelta3/xdelta3-decode.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/xdelta3/xdelta3-decode.h b/xdelta3/xdelta3-decode.h
index b44dae4..dc28323 100644
--- a/xdelta3/xdelta3-decode.h
+++ b/xdelta3/xdelta3-decode.h
@@ -162,6 +162,9 @@ xd3_decode_allocate (xd3_stream *stream,
162 uint8_t **buf_ptr, 162 uint8_t **buf_ptr,
163 usize_t *buf_alloc) 163 usize_t *buf_alloc)
164{ 164{
165 IF_DEBUG2 (DP(RINT "[xd3_decode_allocate] size %u alloc %u\n",
166 size, *buf_alloc));
167
165 if (*buf_ptr != NULL && *buf_alloc < size) 168 if (*buf_ptr != NULL && *buf_alloc < size)
166 { 169 {
167 xd3_free (stream, *buf_ptr); 170 xd3_free (stream, *buf_ptr);
@@ -204,6 +207,9 @@ xd3_decode_section (xd3_stream *stream,
204 /* No allocation/copy needed */ 207 /* No allocation/copy needed */
205 section->buf = stream->next_in; 208 section->buf = stream->next_in;
206 sect_take = section->size; 209 sect_take = section->size;
210
211 IF_DEBUG2 (DP(RINT "[xd3_decode_section] copy==0 @ 0 %u\n",
212 sect_take, section->alloc1));
207 } 213 }
208 else 214 else
209 { 215 {
@@ -227,6 +233,11 @@ xd3_decode_section (xd3_stream *stream,
227 section->buf = section->copied1; 233 section->buf = section->copied1;
228 } 234 }
229 235
236 IF_DEBUG2 (DP(RINT "[xd3_decode_section] take %u @ %u[%u] size %u\n",
237 section->pos, sect_take, section->alloc1, section->size));
238
239 XD3_ASSERT (section->pos + sect_take < section->alloc1);
240
230 memcpy (section->copied1 + section->pos, 241 memcpy (section->copied1 + section->pos,
231 stream->next_in, 242 stream->next_in,
232 sect_take); 243 sect_take);