Cross-Platform build scripts for audio plugins
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.

45 lines
1.4KB

  1. Description: fixing another memory leak in FLAC code
  2. CVE-2017-8363
  3. Author: Erik de Castro Lopo
  4. Origin: upstream
  5. Applied-Upstream: https://github.com/erikd/libsndfile/commit/cd7da8dbf6ee4310d21d9e44b385d6797160d9e8 & https://github.com/erikd/libsndfile/commit/5206a9b65e61598fde44d276c81b0585bc428562
  6. Last-Update: 2017-05-28
  7. ---
  8. This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  9. --- libsndfile.orig/src/flac.c
  10. +++ libsndfile/src/flac.c
  11. @@ -430,8 +430,7 @@
  12. static void
  13. sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data)
  14. { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
  15. - FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ;
  16. - int bitwidth = 0, i ;
  17. + int bitwidth = 0 ;
  18. switch (metadata->type)
  19. { case FLAC__METADATA_TYPE_STREAMINFO :
  20. @@ -481,12 +480,6 @@
  21. if (bitwidth > 0)
  22. psf_log_printf (psf, " Bit width : %d\n", bitwidth) ;
  23. -
  24. -
  25. - for (i = 0 ; i < psf->sf.channels ; i++)
  26. - pflac->rbuffer [i] = calloc (FLAC__MAX_BLOCK_SIZE, sizeof (int32_t)) ;
  27. -
  28. - pflac->wbuffer = (const int32_t* const*) pflac->rbuffer ;
  29. break ;
  30. case FLAC__METADATA_TYPE_VORBIS_COMMENT :
  31. @@ -848,7 +841,9 @@
  32. psf_log_printf (psf, "End\n") ;
  33. - if (psf->error == 0)
  34. + if (psf->error != 0)
  35. + FLAC__stream_decoder_delete (pflac->fsd) ;
  36. + else
  37. { FLAC__uint64 position ;
  38. FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;