diff options
author | Andreas Huber <andih@google.com> | 2010-05-24 09:18:36 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-05-24 09:24:02 -0700 |
commit | cbcf8f6311e28a1bc74b780dc72adecbcfe61d44 (patch) | |
tree | 5f51502ef6befa2a19e37a88cfd6b6300f2e32f9 /media/libstagefright/FileSource.cpp | |
parent | 450da449ffb0d856b471c229634ab1d2bc12499a (diff) | |
download | frameworks_base-cbcf8f6311e28a1bc74b780dc72adecbcfe61d44.zip frameworks_base-cbcf8f6311e28a1bc74b780dc72adecbcfe61d44.tar.gz frameworks_base-cbcf8f6311e28a1bc74b780dc72adecbcfe61d44.tar.bz2 |
Interestingly, a call to fseek with a NULL file handle now blocks forever...
Change-Id: Ic80c579abcf2bdb73f7fd1da713649b7c7f25f56
Diffstat (limited to 'media/libstagefright/FileSource.cpp')
-rw-r--r-- | media/libstagefright/FileSource.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/media/libstagefright/FileSource.cpp b/media/libstagefright/FileSource.cpp index b6f1af2..dd2579b 100644 --- a/media/libstagefright/FileSource.cpp +++ b/media/libstagefright/FileSource.cpp @@ -45,6 +45,10 @@ status_t FileSource::initCheck() const { } ssize_t FileSource::readAt(off_t offset, void *data, size_t size) { + if (mFile == NULL) { + return NO_INIT; + } + Mutex::Autolock autoLock(mLock); if (mLength >= 0) { @@ -67,6 +71,10 @@ ssize_t FileSource::readAt(off_t offset, void *data, size_t size) { } status_t FileSource::getSize(off_t *size) { + if (mFile == NULL) { + return NO_INIT; + } + if (mLength >= 0) { *size = mLength; |