Browse Source

fix bug with set_subdata

David Rose 15 years ago
parent
commit
bc0529fce2
1 changed files with 4 additions and 4 deletions
  1. 4 4
      panda/src/gobj/geomVertexArrayData.cxx

+ 4 - 4
panda/src/gobj/geomVertexArrayData.cxx

@@ -888,8 +888,8 @@ set_subdata(size_t start, size_t size, const string &data) {
   if (from_size < size) {
   if (from_size < size) {
     // Reduce the array.
     // Reduce the array.
     unsigned char *pointer = to_buffer.get_write_pointer();
     unsigned char *pointer = to_buffer.get_write_pointer();
-    memmove(pointer + start + size, 
-            pointer + start + from_size,
+    memmove(pointer + start + from_size, 
+            pointer + start + size,
             to_buffer_orig_size - (start + size));
             to_buffer_orig_size - (start + size));
     to_buffer.clean_realloc(to_buffer_orig_size + from_size - size);
     to_buffer.clean_realloc(to_buffer_orig_size + from_size - size);
 
 
@@ -897,8 +897,8 @@ set_subdata(size_t start, size_t size, const string &data) {
     // Expand the array.
     // Expand the array.
     to_buffer.clean_realloc(to_buffer_orig_size + from_size - size);
     to_buffer.clean_realloc(to_buffer_orig_size + from_size - size);
     unsigned char *pointer = to_buffer.get_write_pointer();
     unsigned char *pointer = to_buffer.get_write_pointer();
-    memmove(pointer + start + size, 
-            pointer + start + from_size,
+    memmove(pointer + start + from_size, 
+            pointer + start + size,
             to_buffer_orig_size - (start + size));
             to_buffer_orig_size - (start + size));
   }
   }