]> sigrok.org Git - pulseview.git/commitdiff
Pad mip-map buffers to allow for uint64_t write word
authorJoel Holdsworth <redacted>
Sun, 3 Mar 2013 11:43:38 +0000 (11:43 +0000)
committerUwe Hermann <redacted>
Sun, 3 Mar 2013 16:18:21 +0000 (17:18 +0100)
pv/data/logicsnapshot.cpp

index a7a84cf916d1cad33d4f16fb60d7c45b3fbfacd0..af6ac0e8c367a097372aeea376cef6c101785e8b 100644 (file)
@@ -77,7 +77,10 @@ void LogicSnapshot::reallocate_mip_map(MipMapLevel &m)
        if (new_data_length > m.data_length)
        {
                m.data_length = new_data_length;
-               m.data = realloc(m.data, new_data_length * _unit_size);
+
+               // Padding is added to allow for the uint64_t write word
+               m.data = realloc(m.data, new_data_length * _unit_size +
+                       sizeof(uint64_t));
        }
 }