In Bento4 1.5.1-627, AP4_DataBuffer::SetDataSize does not handle reallocation failures, leading to a memory copy into a NULL pointer. This is different from CVE-2018-20186.
Hi, recently when I experience the new version of bento4. I find an NPD bug in program "mp42aac".

`./mp42acc inputs`

The bug logic is that when the data size is not large enough and apply reallocation, the reallocation does not check whether the new buffer is successfully allocated.
This is the execution trace.
4c7a.png">
<img width="1369" alt="image" src="https://user-images.githubusercontent.com/7632714/58330114-c4810880-7e68-11e9-82e1-cc33671c63dc.png">


In SetDataSize, the function realloc buffer when new size is larger than the current one.
This means the two values of two size variable are not zero.
![image](https://user-images.githubusercontent.com/7632714/57675075-76dbf300-7653-11e9-9474-9c774d116266.png)
In reallocation, there is no null pointer check for the return value of the allocation and leads to the crash when apply AP4_CopyMemory which is an alias of memcpy function.
![image](https://user-images.githubusercontent.com/7632714/57675256-02558400-7654-11e9-8aeb-be197543614c.png)


I have uploaded the report and related bug trace to help understand this problem.
[report_input.zip](https://github.com/axiomatic-systems/Bento4/files/3176121/report_input.zip)
Null Pointer Dereference(npd) Bug
This is a GitHub Issue
repo:Bento4
owner:axiomatic-systems
Title : Null Pointer Dereference(npd) Bug
Issue date:

--- start body ---
Hi, recently when I experience the new version of bento4. I find an NPD bug in program "mp42aac".

`./mp42acc inputs`

The bug logic is that when the data size is not large enough and apply reallocation, the reallocation does not check whether the new buffer is successfully allocated.
This is the execution trace.
4c7a.png">
<img width="1369" alt="image" src="https://user-images.githubusercontent.com/7632714/58330114-c4810880-7e68-11e9-82e1-cc33671c63dc.png">


In SetDataSize, the function realloc buffer when new size is larger than the current one.
This means the two values of two size variable are not zero.
![image](https://user-images.githubusercontent.com/7632714/57675075-76dbf300-7653-11e9-9474-9c774d116266.png)
In reallocation, there is no null pointer check for the return value of the allocation and leads to the crash when apply AP4_CopyMemory which is an alias of memcpy function.
![image](https://user-images.githubusercontent.com/7632714/57675256-02558400-7654-11e9-8aeb-be197543614c.png)


I have uploaded the report and related bug trace to help understand this problem.
[report_input.zip](https://github.com/axiomatic-systems/Bento4/files/3176121/report_input.zip)
--- end body ---

A null pointer dereference (NPD) vulnerability in the Bento4 program 'mp42aac' occurs when reallocating memory without checking if the allocation was successful. This can lead to a crash when attempting to use the newly allocated buffer, as the program may attempt to access a null pointer if the allocation fails.