From: John Stebbins Date: Wed, 16 Jan 2019 00:35:27 +0000 (-0800) Subject: Fix potential NULL pointer dereference X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7dcbdcce4b33473f679594403b98bdda330b1b49;p=handbrake Fix potential NULL pointer dereference --- 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;