You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1014 B

  1. From 4f47b63e9c971e6391590caf00a0f2a5ed612e67 Mon Sep 17 00:00:00 2001
  2. From: Erik de Castro Lopo <erikd@mega-nerd.com>
  3. Date: Sat, 8 Apr 2017 18:34:49 +1000
  4. Subject: [PATCH] stream_decoder.c: Fix a memory leak
  5. Leak reported by Secunia Research.
  6. ---
  7. src/libFLAC/stream_decoder.c | 3 +++
  8. 1 file changed, 3 insertions(+)
  9. diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
  10. index 14d5fe7f..a5527511 100644
  11. --- a/src/libFLAC/stream_decoder.c
  12. +++ b/src/libFLAC/stream_decoder.c
  13. @@ -1759,6 +1759,9 @@ FLAC__bool read_metadata_vorbiscomment_(FLAC__StreamDecoder *decoder, FLAC__Stre
  14. }
  15. memset (obj->comments[i].entry, 0, obj->comments[i].length) ;
  16. if (!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->comments[i].entry, obj->comments[i].length)) {
  17. + /* Current i-th entry is bad, so we delete it. */
  18. + free (obj->comments[i].entry) ;
  19. + obj->comments[i].entry = NULL ;
  20. obj->num_comments = i;
  21. goto skip;
  22. }
  23. --
  24. 2.17.0