summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-03-23 11:24:25 -0600
committerJohn Stebbins <[email protected]>2016-03-23 11:24:25 -0600
commitc8e815e99f58fa5eee8366649ccf20b4381f883f (patch)
treeed0ec13fa7ff11a2489587a462515ab330d3d27b
parent8f2464fe6cb49d23f2191684a70eeae9d948e808 (diff)
fifo: when HB_BUFFER_DEBUG is set, memset buffers to 0
-rw-r--r--libhb/fifo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libhb/fifo.c b/libhb/fifo.c
index 62a34b8b3..508dfba1d 100644
--- a/libhb/fifo.c
+++ b/libhb/fifo.c
@@ -430,6 +430,9 @@ hb_buffer_t * hb_buffer_init_internal( int size , int needsMapped )
free( b );
return NULL;
}
+#if defined(HB_BUFFER_DEBUG)
+ memset(b->data, 0, b->size);
+#endif
hb_lock(buffers.lock);
buffers.allocated += b->alloc;
hb_unlock(buffers.lock);
@@ -465,6 +468,9 @@ void hb_buffer_realloc( hb_buffer_t * b, int size )
size = size_to_pool( size )->buffer_size;
b->data = realloc( b->data, size );
b->alloc = size;
+#if defined(HB_BUFFER_DEBUG)
+ memset(b->data, 0, b->size);
+#endif
hb_lock(buffers.lock);
buffers.allocated += size - orig;