summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-01-15 16:35:27 -0800
committerJohn Stebbins <[email protected]>2019-01-20 11:06:51 -0800
commit7dcbdcce4b33473f679594403b98bdda330b1b49 (patch)
treeac8ed2182fe34537744f1cd3b36a9e0ce0de89ee
parent5f10e030d7d5029b6470485a70d377ebec9c77db (diff)
Fix potential NULL pointer dereference
-rw-r--r--libhb/fifo.c7
1 files changed, 5 insertions, 2 deletions
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;