Added a specific NULL check to cdrom/cdrom_image_backend.c to please cppcheck.

This commit is contained in:
OBattler
2023-06-18 23:51:15 +02:00
parent 1e3154cb74
commit c183b1da38

View File

@@ -768,7 +768,7 @@ cdi_add_track(cd_img_t *cdi, track_t *cur, uint64_t *shift, uint64_t prestart, u
} }
/* First track (track number must be 1). */ /* First track (track number must be 1). */
if (cdi->tracks_num == 0) { if ((prev == NULL) || (cdi->tracks_num == 0)) {
/* I guess this makes sure the structure is not filled with invalid data. */ /* I guess this makes sure the structure is not filled with invalid data. */
if (cur->number != 1) if (cur->number != 1)
return 0; return 0;