Pullup ticket 2790 - requested by tron
[pkgsrc.git] / audio / libsndfile / patches / patch-ad
1 $NetBSD: patch-ad,v 1.12 2009/06/08 09:30:17 tron Exp $
2
3 Upstream fix for DoS vulnerability taken from here:
4
5 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530831
6
7 --- src/pcm.c.orig      2009-03-22 19:17:14.000000000 +0000
8 +++ src/pcm.c   2009-06-08 10:03:02.000000000 +0100
9 @@ -271,7 +271,7 @@
10         else
11                 psf->datalength = 0 ;
12  
13 -       psf->sf.frames = psf->datalength / psf->blockwidth ;
14 +       psf->sf.frames = psf->blockwidth > 0 ? psf->datalength / psf->blockwidth : 0 ;
15  
16         return 0 ;
17  } /* pcm_init */