diff --git a/libexif/huawei/exif-mnote-data-huawei.c b/libexif/huawei/exif-mnote-data-huawei.c index 4c32a6fc5643f6cc29bf62c6436b06542deecf99..af0fa2fadd9c89f04865a8b56dd210e5d5620dfb 100644 --- a/libexif/huawei/exif-mnote-data-huawei.c +++ b/libexif/huawei/exif-mnote-data-huawei.c @@ -210,7 +210,7 @@ exif_mnote_data_huawei_save (ExifMnoteData *ne, unsigned char **buf, unsigned in unsigned int malloc_size = sizeof(HUAWEI_HEADER); exif_mnote_data_huawei_malloc_size_data(ne, &malloc_size); - if (!malloc_size) { + if (malloc_size < HUAWEI_HEADER_OFFSET) { exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteHuawei", "The memory(%d) request failed", malloc_size); return; }