Package: libsndfile / 1.0.21-3+squeeze2

02flac_zero_len.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## 02flac_zero_len.diff by Erik de Castro Lopo <erikd@mega-nerd.com>
##
## DP: Handle case where FLAC metadata says the file has zero frames.
## DP: See Debian bug #590752.
--- libsndfile-1.0.21.orig/src/flac.c	2009-10-13 20:42:19 +0000
+++ libsndfile-1.0.21/src/flac.c	2010-08-02 09:22:08 +0000
@@ -405,7 +405,14 @@
 			psf->sf.samplerate = metadata->data.stream_info.sample_rate ;
 			psf->sf.frames = metadata->data.stream_info.total_samples ;

-			psf_log_printf (psf, "FLAC Stream Metadata\n  Channels    : %d\n  Sample rate : %d\n  Frames      : %D\n", psf->sf.channels, psf->sf.samplerate, psf->sf.frames) ;
+			psf_log_printf (psf, "FLAC Stream Metadata\n  Channels    : %d\n  Sample rate : %d\n", psf->sf.channels, psf->sf.samplerate) ;
+
+			if (psf->sf.frames == 0)
+			{	psf_log_printf (psf, "  Frames      : 0 (bumping to SF_COUNT_MAX)\n") ;
+				psf->sf.frames = SF_COUNT_MAX ;
+				}
+			else
+				psf_log_printf (psf, "  Frames      : %D\n", psf->sf.frames) ;

 			switch (metadata->data.stream_info.bits_per_sample)
 			{	case 8 :