diff options
author | Andreas Huber <andih@google.com> | 2010-10-27 10:39:57 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-27 10:39:57 -0700 |
commit | 936747d672924d797c1f11c90efbf871f5ab04bb (patch) | |
tree | 27c47b8608bf5bb785f1ef12768873c9589ebfb9 /media | |
parent | 73b1089d9e626d53eb1a20cea800cfde65eb4299 (diff) | |
parent | 7459b018db9aecea809add574cfa1b5ca72c47dd (diff) | |
download | frameworks_base-936747d672924d797c1f11c90efbf871f5ab04bb.zip frameworks_base-936747d672924d797c1f11c90efbf871f5ab04bb.tar.gz frameworks_base-936747d672924d797c1f11c90efbf871f5ab04bb.tar.bz2 |
Merge "FileSource may fail to open a file in which case subsequent code dereferences a NULL pointer. This fixes this recently introduced problem."
Diffstat (limited to 'media')
-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), |