]> granicus.if.org Git - handbrake/commitdiff
Fix potential NULL pointer dereference
authorJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 16 Jan 2019 00:35:27 +0000 (16:35 -0800)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Sun, 20 Jan 2019 19:06:51 +0000 (11:06 -0800)
libhb/fifo.c

index 4288f57002fcfa6d991a2354123e050c35c88ff6..70c3eca8177f7573de946667985675a04f609d69 100644 (file)
@@ -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;