feat(image_decoder): add stride warning (#5471)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech
2024-02-15 17:14:31 +08:00
committed by GitHub
parent 1238b21cb8
commit baf7fedc82
+4 -1
View File
@@ -336,7 +336,10 @@ static lv_image_decoder_t * image_decoder_get_info(const void * src, lv_image_he
if(decoder->info_cb && decoder->open_cb) {
lv_result_t res = decoder->info_cb(decoder, src, header);
if(res == LV_RESULT_OK) {
if(header->stride == 0) header->stride = img_width_to_stride(header);
if(header->stride == 0) {
LV_LOG_INFO("Image decoder didn't set stride. Calculate it from width.");
header->stride = img_width_to_stride(header);
}
break;
}
}