src/sndfile.c : Prevent psf->codec_close() being called more than once.

This commit is contained in:
Erik de Castro Lopo 2012-01-05 18:12:57 +11:00
parent 6f26709560
commit a3218e1aa1
2 changed files with 9 additions and 2 deletions

View File

@ -9,6 +9,9 @@
* tests/chunk_test.c tests/test_wrapper.sh.in
Test CAF files with custom chunks.
* src/sndfile.c
Prevent psf->codec_close() being called more than once.
2012-01-04 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* programs/sndfile-cmp.c

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 1999-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 1999-2012 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
@ -2522,7 +2522,11 @@ psf_close (SF_PRIVATE *psf)
int error = 0 ;
if (psf->codec_close)
error = psf->codec_close (psf) ;
{ error = psf->codec_close (psf) ;
/* To prevent it being called in psf->container_close(). */
psf->codec_close = NULL ;
} ;
if (psf->container_close)
error = psf->container_close (psf) ;