diff options
Diffstat (limited to 'spuencoder.c')
-rw-r--r-- | spuencoder.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spuencoder.c b/spuencoder.c index ed9e722..7c1125c 100644 --- a/spuencoder.c +++ b/spuencoder.c @@ -74,6 +74,9 @@ void cSpuEncoder::encode(cBitmap *bmap, int top, int left) this->top = top; this->left = left; + // set initial value + data = NULL; + // prepare datastructures memset(rleData.top, 0, sizeof(rleData.top)); memset(rleData.bottom, 0, sizeof(rleData.bottom)); @@ -125,6 +128,11 @@ void cSpuEncoder::encode(cBitmap *bmap, int top, int left) // we are ready to send generated spu data dsyslog("[dxr3-spuencoder] spu packet size %d (bytes). %d left", written, (MAX_SPU_DATA - written)); cDxr3Interface::instance()->WriteSpu((uchar *)&spu, written); + + if (data) { + delete data; + data = NULL; + } } void cSpuEncoder::writeNibble(uint8_t val) |