diff options
Diffstat (limited to 'src/frame.cc')
-rw-r--r-- | src/frame.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/frame.cc b/src/frame.cc index 6a1ba70..4b94fcb 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -28,13 +28,20 @@ #include "debug.h" +#include <memory.h> +#include <stdlib.h> + Frame::Frame(unsigned char *d, int sz) { - data = d; + data = (unsigned char *)malloc(sz); + memcpy(data, d, sz); size = sz; } Frame::~Frame() { + free(data); + data = NULL; + size = 0; } |