TLIGHT_PRODUCTS / WS281X
Revision:
32:64c391617f6c
Parent:
30:59b70f91b471
Child:
46:2374900f8845
--- a/WS281X.h	Tue Sep 13 12:04:51 2016 +0000
+++ b/WS281X.h	Thu Oct 13 23:51:20 2016 +0000
@@ -130,14 +130,14 @@
 
     RGBColor operator[](int index) const
     {
-        if ((uint16_t)index < _numPixels)
+        if (_pixels && (uint16_t)index < _numPixels)
             return _pixels[index];
         return _dummyPixel;
     }
 
     RGBColor& operator[](int index)
     {
-        if ((uint16_t)index < _numPixels)
+        if (_pixels && (uint16_t)index < _numPixels)
             return _pixels[index];
         return _dummyPixel;
     }
@@ -152,7 +152,7 @@
     RGBOrder _rgbOrder;
     int _1st, _2nd, _3rd;
 
-    bool     _buf_owner;
+    bool     _owned_buffer;
     uint16_t _maxPixels;
     uint16_t _numPixels;
     RGBColor *_pixels;