[COV] cuesheet.c var line could be uninitialized

Change-Id: Id753ecc28f4029e05032be0c0ac6ecd27e9e370f
This commit is contained in:
William Wilgus 2022-03-18 18:57:55 -04:00
parent 99f8457279
commit b31444261e

View file

@ -222,7 +222,8 @@ bool parse_cuesheet(struct cuesheet_file *cue_file, struct cuesheet *cue)
/* Look for a Unicode BOM */
unsigned char bom_read = 0;
read(fd, line, BOM_UTF_8_SIZE);
if (read(fd, line, BOM_UTF_8_SIZE) > 0)
{
if(!memcmp(line, BOM_UTF_8, BOM_UTF_8_SIZE))
{
char_enc = CHAR_ENC_UTF_8;
@ -238,6 +239,8 @@ bool parse_cuesheet(struct cuesheet_file *cue_file, struct cuesheet *cue)
char_enc = CHAR_ENC_UTF_16_BE;
bom_read = BOM_UTF_16_SIZE;
}
}
if (bom_read < BOM_UTF_8_SIZE)
lseek(fd, cue_file->pos + bom_read, SEEK_SET);
if (is_embedded)