Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index 86c057a..5b2ce5e 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c @@ -595,7 +595,12 @@ int read_bmp_fd(int fd, #endif unsigned mask; unsigned char *p; +#if BM_MAX_WIDTH < LCD_WIDTH + int len; + if)) +#else if) +#endif return -9; /* Convert to destination format */ @@ -691,6 +696,15 @@ int read_bmp_fd(int fd, for { if delta = DITHERXDY(col,dy); +#if BM_MAX_WIDTH < LCD_WIDTH + if + { + if)) + return -9; + qp = (struct uint8_rgb*)ba.buf; + } + len--; +#endif q0 = *qp++; r = (31 * q0.red + (q0.red >> 3) + delta) >> 8; g = (63 * q0.green + (q0.green >> 2) + delta) >> 8; diff --git a/apps/recorder/bmp.h b/apps/recorder/bmp.h index c53f295..c42c0b9 100644 --- a/apps/recorder/bmp.h +++ b/apps/recorder/bmp.h @@ -33,7 +33,8 @@ -#define + 7) & ~7) +//#define BM_MAX_WIDTH (((LCD_WIDTH) + 7) & ~7) +#define BM_MAX_WIDTH 8 struct uint8_rgb { uint8_t blue; |