shithub: sox

Download patch

ref: 80350b88e58095f5c37ca8013538fc5461adb257
parent: f5afb3930673306a62ae50948af973c66331b002
author: robs <robs>
date: Sat Apr 21 14:55:05 EDT 2007

Fix crash when no comment

--- a/src/flac.c
+++ b/src/flac.c
@@ -471,7 +471,8 @@
   Encoder * encoder = (Encoder *) format->priv;
   FLAC__StreamEncoderState state = FLAC__stream_encoder_get_state(encoder->flac);
 
-  FLAC__metadata_object_delete(encoder->metadata);
+  if (encoder->metadata)
+    FLAC__metadata_object_delete(encoder->metadata);
   FLAC__stream_encoder_finish(encoder->flac);
   FLAC__stream_encoder_delete(encoder->flac);
   free(encoder->decoded_samples);