Fix corruption in first line of Waveshare image
This commit is contained in:
1 file changed
+1
-1
@@ -65,7 +65,7 @@ gdImagePtr img_palettize(gdImagePtr rgb, int * palette, int palette_size) {
|
|||||||
* Note that we are storing two extra values so we don't have to do boundary checking at
|
* Note that we are storing two extra values so we don't have to do boundary checking at
|
||||||
* the left and right edges of the image.
|
* the left and right edges of the image.
|
||||||
*/
|
*/
|
||||||
struct ycbcr_t * forward = malloc((gdImageSX(rgb) + 2) * sizeof(struct ycbcr_t));
|
struct ycbcr_t * forward = calloc(gdImageSX(rgb) + 2, sizeof(struct ycbcr_t));
|
||||||
if (!forward) {
|
if (!forward) {
|
||||||
free(pal_ycbcr);
|
free(pal_ycbcr);
|
||||||
gdImageDestroy(res);
|
gdImageDestroy(res);
|
||||||
|
|||||||
Reference in new issue
Block a user