null-terminate exif strings
libexif strings are not null-terminated, add a \0 before adding to the vips image thanks Mike
This commit is contained in:
parent
7bf40144b9
commit
02095763c9
@ -1,6 +1,7 @@
|
|||||||
3/7/13 started 7.34.2
|
3/7/13 started 7.34.2
|
||||||
- lower priority for Matlab load to reduce segvs from Mat_Open(), thanks
|
- lower priority for Matlab load to reduce segvs from Mat_Open(), thanks
|
||||||
Michael
|
Michael
|
||||||
|
- null-terminate libexif strings, thanks Mike
|
||||||
|
|
||||||
28/6/13 started 7.34.1
|
28/6/13 started 7.34.1
|
||||||
- fix morphological operators on non-uchar images
|
- fix morphological operators on non-uchar images
|
||||||
|
@ -53,6 +53,8 @@
|
|||||||
* 21/11/12
|
* 21/11/12
|
||||||
* - don't insist exif must have data
|
* - don't insist exif must have data
|
||||||
* - attach IPCT data (app13), thanks Gary
|
* - attach IPCT data (app13), thanks Gary
|
||||||
|
* 6/7/13
|
||||||
|
* - null-terminate exif strings, thanks Mike
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -407,8 +409,16 @@ vips_exif_to_s( ExifData *ed, ExifEntry *entry, VipsBuf *buf )
|
|||||||
ExifSRational srv;
|
ExifSRational srv;
|
||||||
char txt[256];
|
char txt[256];
|
||||||
|
|
||||||
if( entry->format == EXIF_FORMAT_ASCII )
|
if( entry->format == EXIF_FORMAT_ASCII ) {
|
||||||
vips_buf_appendf( buf, "%s ", entry->data );
|
/* libexif does not null-terminate strings. Copy out and add
|
||||||
|
* the \0 ourselves.
|
||||||
|
*/
|
||||||
|
int len = VIPS_MIN( 254, entry->size );
|
||||||
|
|
||||||
|
memcpy( txt, entry->data, len );
|
||||||
|
txt[len] = '\0';
|
||||||
|
vips_buf_appendf( buf, "%s ", txt );
|
||||||
|
}
|
||||||
else if( entry->components < 10 &&
|
else if( entry->components < 10 &&
|
||||||
!vips_exif_get_int( ed, entry, 0, &iv ) ) {
|
!vips_exif_get_int( ed, entry, 0, &iv ) ) {
|
||||||
for( i = 0; i < entry->components; i++ ) {
|
for( i = 0; i < entry->components; i++ ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user