Thanks for the fix, and sorry for the delay.

On Apr 23 14:40:04, b...@comstyle.com wrote:
> A bug fix from upstream..
> gsm610: Fix signed integer overflow

On each of current/{amd64, arm64, armv7}
it builds, runs, and does not break this:

        sox -c 1 -b 8 -r 8000 -n file.wav synth 5 sin gain -6
        sndfile-convert file.wav file.gsm
        sndfile-play file.gsm

However, the original problem reported at
https://github.com/libsndfile/libsndfile/issues/785
now looks like this:

$ sndfile-metadata-get /tmp/poc_sio

Open of file '/tmp/poc_sio' failed :
Internal error : SF_INFO struct incomplete.

$ sndfile-info /tmp/poc_sio
        
Error : Not able to open input file /tmp/poc_sio.
File : /tmp/poc_sio
Length : 3782
FORM : 3774
 AIFC
 FVER : 4
 COMM : 24
  Sample Rate : 11025
  Frames      : 16384
  Channels    : 1
  Sample Size : 16
  Encoding    : GSM 
 SSND : 3408
  Offset     : 536870912
  Block Size : 0 ???
 ANNO : This is really quite a long comment. It is designed to be long enough 
to screw up the encoders and decoders if the file container format does not 
handle things correctly. If everything is working correctly, the decoder will 
only decode the actual audio data, and not this string at the end of the file.
*** Warning : data chunk seems to be truncated.
*** Frame count read from 'COMM' chunk (16384) not equal to frame count
*** calculated from length of 'SSND' chunk (1691973536).
---------------------------------
 Sample rate :   11025
 Frames      :   -2602993760
 Channels    :   1
 Format      :   0x20020
 Sections    :   1
 Seekable    :   FALSE
---------------------------------
Internal error : SF_INFO struct incomplete.


I'm not sure how it relates to the inttype fix.
It reports that the comment appears truncated (not having the length),
but at the same time it somehow botches the SF_INFO structure.

        Jan


> Index: Makefile
> ===================================================================
> RCS file: /home/cvs/ports/audio/libsndfile/Makefile,v
> retrieving revision 1.41
> diff -u -p -u -p -r1.41 Makefile
> --- Makefile  3 Apr 2022 11:12:38 -0000       1.41
> +++ Makefile  14 Apr 2022 21:20:02 -0000
> @@ -3,6 +3,7 @@ COMMENT=      library to handle various audio
>  GH_ACCOUNT=  libsndfile
>  GH_PROJECT=  libsndfile
>  GH_TAGNAME=  1.1.0
> +REVISION=    0
>  CATEGORIES=  audio
>  
>  HOMEPAGE=    https://libsndfile.github.io/libsndfile/
> Index: patches/patch-src_gsm610_c
> ===================================================================
> RCS file: patches/patch-src_gsm610_c
> diff -N patches/patch-src_gsm610_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_gsm610_c        14 Apr 2022 21:26:35 -0000
> @@ -0,0 +1,15 @@
> +gsm610: Fix signed integer overflow
> +d6f83cd4feb154efcf5614601985ae2ce9d9fa6d
> +
> +Index: src/gsm610.c
> +--- src/gsm610.c.orig
> ++++ src/gsm610.c
> +@@ -150,7 +150,7 @@ Need separate gsm_data structs for encode and decode.
> +                     pgsm610->blocks = psf->datalength / pgsm610->blocksize 
> + 1 ;
> +                     } ;
> + 
> +-            psf->sf.frames = pgsm610->samplesperblock * pgsm610->blocks ;
> ++            psf->sf.frames = (sf_count_t) pgsm610->samplesperblock * 
> pgsm610->blocks ;
> + 
> +             psf_fseek (psf, psf->dataoffset, SEEK_SET) ;
> + 
> 
> 

Reply via email to