diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2007-06-14 19:07:34 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2007-06-14 19:07:34 +1000 |
commit | 43d11aa41defbe5aea664935d5c95eac1a90bd39 (patch) | |
tree | 74b9713c0e218fbadb6df8cd16930f93f4260738 | |
parent | a7749dc5d44c30000ea89fbccf12480d6b87cc58 (diff) |
src/sndfile.hh : Fix constructor so subsequent calls to other methods don't segfault.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | doc/development.html | 6 | ||||
-rwxr-xr-x | reconfigure.mk | 5 | ||||
-rw-r--r-- | src/sndfile.hh | 23 |
4 files changed, 22 insertions, 21 deletions
@@ -1,3 +1,12 @@ +2007-06-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com> + + * tests/cpp_test.cc + Add extra tests for when the SndfileHandle constructor fails. + + * src/sndfile.hh + Make sure failure to open the file in the constructor does not allow later + calls to other methods to fail. + 2007-06-10 Erik de Castro Lopo <erikd AT mega-nerd DOT com> * tests/util.tpl diff --git a/doc/development.html b/doc/development.html index 81397fe..61fbda4 100644 --- a/doc/development.html +++ b/doc/development.html @@ -34,8 +34,8 @@ it on windows. <!-- pepper --> <P> The main archive archive can be found at: -<A HREF="http://www.mega-nerd.com/Bzr/libsndfile-mdev/"> - http://www.mega-nerd.com/Bzr/libsndfile-mdev/</A> +<A HREF="http://www.mega-nerd.com/Bzr/libsndfile-pub/"> + http://www.mega-nerd.com/Bzr/libsndfile-pub/</A> </P> <!-- pepper --> <P> @@ -44,7 +44,7 @@ you can do: </P> <!-- pepper --> <PRE> - bzr get http://www.mega-nerd.com/Bzr/libsndfile-mdev/ + bzr get http://www.mega-nerd.com/Bzr/libsndfile-pub/ </PRE> <!-- pepper --> <P> diff --git a/reconfigure.mk b/reconfigure.mk index 1cc9cfb..bd65bc8 100755 --- a/reconfigure.mk +++ b/reconfigure.mk @@ -52,7 +52,8 @@ aclocal.m4: acinclude.m4 $(ACLOCAL) $(ACLOCAL_INC) clean: - rm -f libtool ltmain.sh aclocal.m4 Makefile.in src/config.h.in config.cache config.status + rm -f libtool ltmain.sh aclocal.m4 src/config.h.in config.cache config.status + rm -rf autom4te.cache + find . -name Makefile.in -exec rm -f {} \; find . -name .deps -type d -exec rm -rf {} \; - diff --git a/src/sndfile.hh b/src/sndfile.hh index dcf2773..e84054b 100644 --- a/src/sndfile.hh +++ b/src/sndfile.hh @@ -1,5 +1,5 @@ /* -** Copyright (C) 2005,2006 Erik de Castro Lopo <erikd@mega-nerd.com> +** Copyright (C) 2005-2007 Erik de Castro Lopo <erikd@mega-nerd.com> ** ** All rights reserved. ** @@ -163,11 +163,10 @@ SndfileHandle::SndfileHandle (const char *path, int mode, int fmt, int chans, in p->sfinfo.sections = 0 ; p->sfinfo.seekable = 0 ; - if ((p->sf = sf_open (path, mode, &p->sfinfo)) == NULL) - { delete p ; - p = NULL ; - } ; + p->sf = sf_open (path, mode, &p->sfinfo) ; } ; + + return ; } /* SndfileHandle const char * constructor */ inline @@ -186,11 +185,10 @@ SndfileHandle::SndfileHandle (std::string const & path, int mode, int fmt, int c p->sfinfo.sections = 0 ; p->sfinfo.seekable = 0 ; - if ((p->sf = sf_open (path.c_str (), mode, &p->sfinfo)) == NULL) - { delete p ; - p = NULL ; - } ; + p->sf = sf_open (path.c_str (), mode, &p->sfinfo) ; } ; + + return ; } /* SndfileHandle std::string constructor */ inline @@ -342,10 +340,3 @@ SndfileHandle::writeRaw (const void *ptr, sf_count_t bytes) #endif /* SNDFILE_HH */ -/* -** Do not edit or modify anything in this comment block. -** The following line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: a0e9d996-73d7-47c4-a78d-79a3232a9eef -*/ |