From 7dcbdcce4b33473f679594403b98bdda330b1b49 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Tue, 15 Jan 2019 16:35:27 -0800 Subject: Fix potential NULL pointer dereference --- libhb/fifo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libhb') diff --git a/libhb/fifo.c b/libhb/fifo.c index 4288f5700..70c3eca81 100644 --- a/libhb/fifo.c +++ b/libhb/fifo.c @@ -450,8 +450,11 @@ void hb_buffer_realloc( hb_buffer_t * b, int size ) { return; } - memcpy(tmp, b->data, b->alloc); - av_free(b->data); + if (b->data != NULL) + { + memcpy(tmp, b->data, b->alloc); + av_free(b->data); + } b->data = tmp; b->alloc = size; -- cgit v1.2.3