diff --git a/libexif/huawei/exif-mnote-data-huawei.c b/libexif/huawei/exif-mnote-data-huawei.c index 39617e0b1bf407c8734ea33df148adf2ec7fa5db..9651b2321db1d4abe7efe4776ba591b336b7cb0d 100644 --- a/libexif/huawei/exif-mnote-data-huawei.c +++ b/libexif/huawei/exif-mnote-data-huawei.c @@ -208,7 +208,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 < 8) { exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteHuawei", "The memory(%d) request failed", malloc_size); return; }