diff options
author | Andreas Huber <andih@google.com> | 2010-10-27 10:33:04 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-10-27 10:33:04 -0700 |
commit | 7459b018db9aecea809add574cfa1b5ca72c47dd (patch) | |
tree | f341359267f18526e1478b17fd1661368a5114ff /media/libstagefright/FileSource.cpp | |
parent | 81bd788ecf1cd2f460c19f9a29464ee00f5ef8cf (diff) | |
download | frameworks_base-7459b018db9aecea809add574cfa1b5ca72c47dd.zip frameworks_base-7459b018db9aecea809add574cfa1b5ca72c47dd.tar.gz frameworks_base-7459b018db9aecea809add574cfa1b5ca72c47dd.tar.bz2 |
FileSource may fail to open a file in which case subsequent code dereferences a NULL pointer. This fixes this recently introduced problem.
Change-Id: I60dd9532b694a1b488743b71f43e107c778d6683
Diffstat (limited to 'media/libstagefright/FileSource.cpp')
-rw-r--r-- | media/libstagefright/FileSource.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libstagefright/FileSource.cpp b/media/libstagefright/FileSource.cpp index b46d8d0..e4f9a47 100644 --- a/media/libstagefright/FileSource.cpp +++ b/media/libstagefright/FileSource.cpp @@ -21,7 +21,7 @@ namespace android { FileSource::FileSource(const char *filename) : mFile(fopen(filename, "rb")), - mFd(fileno(mFile)), + mFd(mFile == NULL ? -1 : fileno(mFile)), mOffset(0), mLength(-1), mDecryptHandle(NULL), |