summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MPEG4Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/MPEG4Writer.cpp')
-rw-r--r--media/libstagefright/MPEG4Writer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index 926833f..7f7ddf7 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -2231,7 +2231,9 @@ status_t MPEG4Writer::Track::threadEntry() {
MediaBuffer *buffer;
const char *trackName = mIsAudio ? "Audio" : "Video";
while (!mDone && (err = mSource->read(&buffer)) == OK) {
- if (buffer->range_length() == 0) {
+ if (buffer == NULL) {
+ continue;
+ } else if (buffer->range_length() == 0) {
buffer->release();
buffer = NULL;
++nZeroLengthFrames;