libexif codecheck trunk fix

Signed-off-by: duanhan <duanhan1@huawei.com>
This commit is contained in:
duanhan
2024-10-26 18:19:51 +08:00
parent b8bc0d8a71
commit e7a02c8c2c
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -384,10 +384,10 @@ exif_mnote_data_huawei_load (ExifMnoteData *ne, const unsigned char *buf, unsign
head_offset = 0;
}
if (CHECKOVERFLOW(n->offset + head_offset, buf_size, HUAWEI_HEADER_OFFSET)) {
unsigned int order_offset = n->offset + head_offset + HUAWEI_HEADER_OFFSET;
if (CHECKOVERFLOW(order_offset, buf_size, 2)) {
return;
}
unsigned int order_offset = n->offset + head_offset + HUAWEI_HEADER_OFFSET;
const void *pOrder = buf + order_offset;
//read order
@@ -522,7 +522,7 @@ mnote_huawei_get_entry_count (const ExifMnoteDataHuawei* n, MnoteHuaweiEntryCoun
MnoteHuaweiEntryCount* ec = exif_huawei_entry_count_new();
unsigned int count = exif_mnote_data_huawei_count_data(ne, NULL);
if (!count) {
if (!count || !ec) {
mnote_huawei_free_entry_count(ec);
return;
}
+4 -4
View File
@@ -48,8 +48,8 @@ mnote_huawei_entry_get_value(MnoteHuaweiEntry *e, char *v, unsigned int maxlen)
}
if (e->tag == MNOTE_MICRO_VIDEO_PRESENTATION_TIMESTAMP_US) {
for (int i = 0; i < e->components && write_pos < maxlen; i++) {
int offset = i * exif_format_get_size(e->format);
for (unsigned long i = 0; i < e->components && write_pos < maxlen; i++) {
unsigned long offset = i * exif_format_get_size(e->format);
ExifRational r = exif_get_rational(e->data + offset, e->order);
if (r.denominator == 0) {
write_pos += snprintf(v + write_pos, maxlen - write_pos, "%u ",
@@ -63,7 +63,7 @@ mnote_huawei_entry_get_value(MnoteHuaweiEntry *e, char *v, unsigned int maxlen)
return v;
}
for (int i = 0; i < e->components && write_pos < maxlen; i++) {
for (unsigned long i = 0; i < e->components && write_pos < maxlen; i++) {
if (e->format == EXIF_FORMAT_UNDEFINED) {
data = (e->data + i)[0];
} else if (e->format == EXIF_FORMAT_SLONG) {
@@ -75,7 +75,7 @@ mnote_huawei_entry_get_value(MnoteHuaweiEntry *e, char *v, unsigned int maxlen)
return NULL;
}
write_pos += snprintf(v + write_pos, maxlen - write_pos, "%d ", data);
write_pos += (unsigned int)snprintf(v + write_pos, maxlen - write_pos, "%u ", data);
}
*(v + write_pos - 1) = 0;