This commit is contained in:
iceman1001 committed 2026-06-29 23:37:37 +02:00
1 parent 15ee6977a1
commit 21a11320de
3 files changed
+7 -6

No files matched your search

+4 -4
View File
@@ -40,13 +40,13 @@ gdImagePtr img_palettize(gdImagePtr rgb, int *palette, int palette_size) {
// Create paletized image
gdImagePtr res = gdImageCreate(gdImageSX(rgb), gdImageSY(rgb));
if (!res) {
if (res == NULL) {
return NULL;
}
// Allocate space for palette in YCbCr
struct ycbcr_t *pal_ycbcr = calloc(palette_size, sizeof(struct ycbcr_t));
if (!pal_ycbcr) {
if (pal_ycbcr == NULL) {
gdImageDestroy(res);
return NULL;
}
@@ -61,7 +61,7 @@ gdImagePtr img_palettize(gdImagePtr rgb, int *palette, int palette_size) {
* and gets divided by that amount when it is read.
*/
struct ycbcr_t *forward = calloc(gdImageSX(rgb) + 2, sizeof(struct ycbcr_t));
if (!forward) {
if (forward == NULL) {
free(pal_ycbcr);
gdImageDestroy(res);
return NULL;
@@ -162,7 +162,7 @@ gdImagePtr img_crop_to_fit(gdImagePtr orig, int width, int height) {
res = gdImageCreate(width, height);
}
if (!res) {
if (res == NULL) {
return NULL;
}
+2 -1
View File
@@ -27,8 +27,9 @@ const char *getCurrencyInfo(const char *cn_str) {
// skip last element of AtrTable
for (int i = 0; i < ARRAYLEN(Iso4217Table) - 1; ++i) {
if (strncmp(cn_str, Iso4217Table[i].code, slen) == 0)
if (strncmp(cn_str, Iso4217Table[i].code, slen) == 0) {
return Iso4217Table[i].desc;
}
}
return Iso4217Table[ARRAYLEN(Iso4217Table) - 1].desc;
}
+1 -1
View File
@@ -886,7 +886,7 @@ int exec_mad_test(bool verbose) {
ok |= test_write_overflow(verbose);
ok |= test_aid_not_found(verbose);
ok |= test_write_does_not_touch_trailer();
ok |= test_mad_sector_untouched_after_write(verbose);
ok |= test_mad_sector_untouched_after_write();
ok |= test_encode_decode_roundtrip();
ok |= test_encode_decode_mad2_roundtrip();
ok |= test_mad2_crc_independent(verbose);