Skip to content

Commit 68d859f

Browse files
committed
Merge branch '8.16'
2 parents 7a6eb29 + 82c7c05 commit 68d859f

25 files changed

+72
-37
lines changed

ChangeLog

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@
2727
- heifsave: set image orientation using irot and imir transformations [lovell]
2828
- XYZ2Yxy: guard against divide by zero
2929
- fix MSVC compile error [na-trium-144]
30-
- exif: ensure enumerated entries can to converted to string values [lovell]
30+
- exif: ensure enumerated entries can be converted to string values [lovell]
3131
- gifsave: add support for eval callback, ensure correct return code [lovell]
3232
- tiffsave: honor disc threshold during pyramid save [kleisauke]
3333
- fill_nearest: fix a leak
3434
- colour: use suggested rendering intent as fallback [kleisauke]
3535
- morph: fix Orc path with large masks [kleisauke]
3636
- invertlut: fix final value in some cases
3737
- matrixload: fix file format detect for some matrix types
38+
- radload: improve sanity check of colour-related headers [lovell]
39+
- heifsave: reject multiband images [lovell]
40+
- heifload: prevent possible int overflow for large images [kleisauke]
41+
- tiffload: add missing read loop [kleisauke]
42+
- prevent possible use-after-free when debugging via `--vips-leak` flag [lovell]
43+
- avoid possible overflow when multiplication result is cast up [lovell]
3844

3945
10/10/24 8.16.0
4046

libvips/arithmetic/hist_find_indexed.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ histogram_new(VipsHistFindIndexed *indexed)
117117
!(hist->reg = vips_region_new(indexed->index_ready)))
118118
return NULL;
119119

120-
memset(hist->bins, 0, bands * hist->size * sizeof(double));
121-
memset(hist->init, 0, hist->size * sizeof(int));
120+
memset(hist->bins, 0, (size_t) bands * hist->size * sizeof(double));
121+
memset(hist->init, 0, (size_t) hist->size * sizeof(int));
122122

123123
return hist;
124124
}

libvips/arithmetic/project.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ histogram_new(VipsProject *project)
109109
!hist->row_sums)
110110
return NULL;
111111

112-
memset(hist->column_sums, 0, psize * in->Xsize);
113-
memset(hist->row_sums, 0, psize * in->Ysize);
112+
memset(hist->column_sums, 0, (size_t) psize * in->Xsize);
113+
memset(hist->row_sums, 0, (size_t) psize * in->Ysize);
114114

115115
return hist;
116116
}

libvips/colour/LCh2UCS.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ vips_col_Ch2hcmc(float C, float h)
165165
}
166166

167167
P = cos(VIPS_RAD(k7 * h + k8));
168-
D = k4 + k5 * P * pow(fabs(P), k6);
168+
D = k4 + k5 * P * powf(fabsf(P), k6);
169169
g = C * C * C * C;
170-
f = sqrt(g / (g + 1900.0));
170+
f = sqrtf(g / (g + 1900.0F));
171171
hcmc = h + D * f;
172172

173173
return hcmc;

libvips/conversion/bandfold.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ vips_bandfold_gen(VipsRegion *out_region,
9696
/* We can't use vips_region_region() since we change pixel
9797
* coordinates.
9898
*/
99-
memcpy(q, p, psize * r->width);
99+
memcpy(q, p, (size_t) psize * r->width);
100100
}
101101

102102
return 0;

libvips/conversion/bandunfold.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ vips_bandunfold_gen(VipsRegion *out_region,
9999
/* We can't use vips_region_region() since we change pixel
100100
* coordinates.
101101
*/
102-
memcpy(q, p, r->width * psize);
102+
memcpy(q, p, (size_t) r->width * psize);
103103
}
104104

105105
return 0;

libvips/conversion/composite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ vips_composite_base_blend3(VipsCompositeSequence *seq,
899899
/* You can't sqrt a vector, so we must loop.
900900
*/
901901
for (int b = 0; b < 3; b++) {
902-
double g;
902+
float g;
903903

904904
if (B[b] <= 0.25)
905905
g = ((16 * B[b] - 12) * B[b] + 4) * B[b];

libvips/conversion/embed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ vips_embed_base_paint_edge(VipsEmbedBase *base,
217217
*/
218218
for (y = 0; y < todo.height; y++) {
219219
q = VIPS_REGION_ADDR(out_region, todo.left, todo.top + y);
220-
memcpy(q, p, bs * todo.width);
220+
memcpy(q, p, (size_t) bs * todo.width);
221221
}
222222
}
223223

libvips/foreign/heifload.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ vips_foreign_load_heif_build(VipsObject *object)
351351

352352
heif->ctx = heif_context_alloc();
353353
#ifdef HAVE_HEIF_SET_MAX_IMAGE_SIZE_LIMIT
354+
/* heifsave is limited to a maximum image size of 16384x16384,
355+
* so align the heifload defaults accordingly.
356+
*/
354357
heif_context_set_maximum_image_size_limit(heif->ctx,
355358
heif->unlimited ? USHRT_MAX : 0x4000);
356359
#endif /* HAVE_HEIF_SET_MAX_IMAGE_SIZE_LIMIT */
@@ -998,7 +1001,7 @@ vips_foreign_load_heif_generate(VipsRegion *out_region,
9981001
}
9991002

10001003
memcpy(VIPS_REGION_ADDR(out_region, 0, r->top),
1001-
heif->data + heif->stride * line,
1004+
heif->data + (size_t) heif->stride * line,
10021005
VIPS_IMAGE_SIZEOF_LINE(out_region->im));
10031006

10041007
/* We may need to swap bytes and shift to fill 16 bits.

libvips/foreign/heifsave.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ vips_foreign_save_heif_write_block(VipsRegion *region, VipsRect *area,
466466
int page = (area->top + y) / heif->page_height;
467467
int line = (area->top + y) % heif->page_height;
468468
VipsPel *p = VIPS_REGION_ADDR(region, 0, area->top + y);
469-
VipsPel *q = heif->data + line * heif->stride;
469+
VipsPel *q = heif->data + (size_t) heif->stride * line;
470470

471471
if (vips_foreign_save_heif_pack(heif,
472472
q, p, VIPS_REGION_N_ELEMENTS(region)))
@@ -683,6 +683,15 @@ vips_foreign_save_heif_build(VipsObject *object)
683683
return -1;
684684
}
685685

686+
/* Reject multiband images.
687+
*/
688+
if (save->ready->Type == VIPS_INTERPRETATION_MULTIBAND) {
689+
vips_error("heifsave", _("Unsupported interpretation: %s"),
690+
vips_enum_nick(VIPS_TYPE_INTERPRETATION,
691+
save->ready->Type));
692+
return -1;
693+
}
694+
686695
/* Make a heif image the size of a page. We send sink_disc() output
687696
* here and write a frame each time it fills.
688697
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy