Skip to content

Commit bd1eb5c

Browse files
committed
Fix double free in case of PCM sample load error
This hard to spot bug was caught in Lionel Debroux's honggfuzz tests. Kudos to him! Signed-off-by: Claudio Matsuoka <[email protected]>
1 parent 0935751 commit bd1eb5c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: src/loaders/sample.c

+1
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ int libxmp_load_sample(struct module_data *m, HIO_HANDLE *f, int flags, struct x
410410
#ifndef LIBXMP_CORE_PLAYER
411411
err2:
412412
free(xxs->data - 4);
413+
xxs->data = NULL; /* prevent double free in PCM load error */
413414
#endif
414415
err:
415416
return -1;

0 commit comments

Comments
 (0)