freetronics / FTOLED

Arduino software library to drive OLED display modules
http://www.freetronics.com/oled128
GNU General Public License v3.0
26 stars 18 forks source link

Bug in FTOLED_BMP.cpp #5

Closed danieltian closed 9 years ago

danieltian commented 9 years ago

In FTOLED_BMP.cpp, line 275 reads:

if(bpp != 16)
    free(palette);

This should be:

if(bpp < 16)
    free(palette);

because palette is not malloc'ed unless bpp < 16 (line 191). This bug will freeze the Arduino if 32 bpp images are displayed.

projectgus commented 9 years ago

(Oop, I did a last second amendmessage-force-push which is why this shows up as two commits, entirely my fault for being sneaky.)

Thanks very much for this fix Daniel, I guess I must have gotten lucky with the uninitialised value of palette when I tested this.