summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-10-27 10:39:57 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-27 10:39:57 -0700
commit936747d672924d797c1f11c90efbf871f5ab04bb (patch)
tree27c47b8608bf5bb785f1ef12768873c9589ebfb9 /media
parent73b1089d9e626d53eb1a20cea800cfde65eb4299 (diff)
parent7459b018db9aecea809add574cfa1b5ca72c47dd (diff)
downloadframeworks_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.cpp2
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),