summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spuencoder.c8
-rw-r--r--spuencoder.h1
2 files changed, 9 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)
diff --git a/spuencoder.h b/spuencoder.h
index c48863d..b218edf 100644
--- a/spuencoder.h
+++ b/spuencoder.h
@@ -49,6 +49,7 @@ public:
private:
cBitmap *bitmap;
+ cBitmap *data; // temporary bitmap
int top, left; // start points of bitmap
uint8_t spu[MAX_SPU_DATA];