summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorDave Sparks <davidsparks@android.com>2009-06-26 17:24:22 -0700
committerDave Sparks <davidsparks@android.com>2009-06-26 17:24:22 -0700
commit76aa28371e93829927c66f1a48e39e18e01d704d (patch)
treebffd736e175edbad2f1daeae0868b323631f133c /media
parent5e0a3043af16bc71a4211ee00dc00724de6623a7 (diff)
downloadframeworks_av-76aa28371e93829927c66f1a48e39e18e01d704d.zip
frameworks_av-76aa28371e93829927c66f1a48e39e18e01d704d.tar.gz
frameworks_av-76aa28371e93829927c66f1a48e39e18e01d704d.tar.bz2
We might try to close the Vorbis file twice under certain
circumstances. This fix nulls the mFile member so we don't try to close it twice. Bug 1904783.
Diffstat (limited to 'media')
-rw-r--r--media/libmediaplayerservice/VorbisPlayer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/media/libmediaplayerservice/VorbisPlayer.cpp b/media/libmediaplayerservice/VorbisPlayer.cpp
index 14fd6ce..7f0ef21 100644
--- a/media/libmediaplayerservice/VorbisPlayer.cpp
+++ b/media/libmediaplayerservice/VorbisPlayer.cpp
@@ -345,9 +345,6 @@ status_t VorbisPlayer::reset()
{
LOGV("reset\n");
Mutex::Autolock l(mMutex);
- if (mState != STATE_OPEN) {
- return NO_ERROR;
- }
return reset_nosync();
}
@@ -355,10 +352,13 @@ status_t VorbisPlayer::reset()
status_t VorbisPlayer::reset_nosync()
{
// close file
- ov_clear(&mVorbisFile); // this also closes the FILE
if (mFile != NULL) {
- LOGV("OOPS! Vorbis didn't close the file");
- fclose(mFile);
+ ov_clear(&mVorbisFile); // this also closes the FILE
+ if (mFile != NULL) {
+ LOGV("OOPS! Vorbis didn't close the file");
+ fclose(mFile);
+ mFile = NULL;
+ }
}
mState = STATE_ERROR;