From c183b1da3896d2666a4717b16f9c429cc68fcb66 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 18 Jun 2023 23:51:15 +0200 Subject: [PATCH] Added a specific NULL check to cdrom/cdrom_image_backend.c to please cppcheck. --- src/cdrom/cdrom_image_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cdrom/cdrom_image_backend.c b/src/cdrom/cdrom_image_backend.c index 1d39e8c82..5d8294213 100644 --- a/src/cdrom/cdrom_image_backend.c +++ b/src/cdrom/cdrom_image_backend.c @@ -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). */ - 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. */ if (cur->number != 1) return 0;