mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 21:50:54 +03:00
Merge pull request #5148 from wiredfool/tiff_oob_read
Fix OOB Read when writing TIFF with custom Metadata
This commit is contained in:
commit
416f12e772
|
@ -573,7 +573,6 @@ int ImagingLibTiffEncodeInit(ImagingCodecState state, char *filename, int fp) {
|
||||||
int ImagingLibTiffMergeFieldInfo(ImagingCodecState state, TIFFDataType field_type, int key, int is_var_length){
|
int ImagingLibTiffMergeFieldInfo(ImagingCodecState state, TIFFDataType field_type, int key, int is_var_length){
|
||||||
// Refer to libtiff docs (http://www.simplesystems.org/libtiff/addingtags.html)
|
// Refer to libtiff docs (http://www.simplesystems.org/libtiff/addingtags.html)
|
||||||
TIFFSTATE *clientstate = (TIFFSTATE *)state->context;
|
TIFFSTATE *clientstate = (TIFFSTATE *)state->context;
|
||||||
char field_name[10];
|
|
||||||
uint32 n;
|
uint32 n;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
|
@ -586,7 +585,7 @@ int ImagingLibTiffMergeFieldInfo(ImagingCodecState state, TIFFDataType field_typ
|
||||||
int passcount = 0;
|
int passcount = 0;
|
||||||
|
|
||||||
TIFFFieldInfo info[] = {
|
TIFFFieldInfo info[] = {
|
||||||
{ key, readcount, writecount, field_type, FIELD_CUSTOM, 1, passcount, field_name }
|
{ key, readcount, writecount, field_type, FIELD_CUSTOM, 1, passcount, "CustomField" }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (is_var_length) {
|
if (is_var_length) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user