Skip to content

Commit 5d4e146

Browse files
committed
fix segfault triggered in fuzzy testing (thanks Dennis Felsing for reporting)
1 parent 5013b9f commit 5d4e146

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/open_utils.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,8 @@ static int read_metadata_buff (WavpackMetadata *wpmd, unsigned char *blockbuff,
681681
}
682682

683683
if (wpmd->id & ID_ODD_SIZE) {
684+
if (!wpmd->byte_length) // odd size and zero length makes no sense
685+
return FALSE;
684686
wpmd->id &= ~ID_ODD_SIZE;
685687
wpmd->byte_length--;
686688
}

0 commit comments

Comments
 (0)