Fixed memory leak in MP4 library.

This commit is contained in:
Thulinma 2014-12-16 13:07:09 +01:00
parent 1e7766701d
commit 7822e5c75d

View file

@ -41,6 +41,10 @@ namespace MP4 {
Box & Box::operator = (const Box & rs) {
clear();
if (data) {
free(data);
data = 0;
}
data = rs.data;
managed = false;
payloadOffset = rs.payloadOffset;
@ -55,7 +59,7 @@ namespace MP4 {
/// If managed, this will free the data pointer.
Box::~Box() {
if (managed && data != 0) {
if (managed && data) {
free(data);
data = 0;
}