diff options
author | Shalaj Jain <shalajj@codeaurora.org> | 2015-10-21 19:01:59 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-26 18:18:15 -0700 |
commit | 85ad714b38516807efe40d67da406208d72b0dd0 (patch) | |
tree | 11c47f7fcb8a1190f58d44775e05a1d47199eb50 /media/libstagefright/MediaCodec.cpp | |
parent | 04fdb627d164cc81c8fa2830db1b20cf1261aea4 (diff) | |
download | frameworks_av-85ad714b38516807efe40d67da406208d72b0dd0.zip frameworks_av-85ad714b38516807efe40d67da406208d72b0dd0.tar.gz frameworks_av-85ad714b38516807efe40d67da406208d72b0dd0.tar.bz2 |
stagefright: Return error for wrong buffer index in MediaCodec
Return error if the index passed by client is incorrect rather than
returning OK with null buffer.
Also add a null buffer check in MPEG4Writer as it shouldn't rely on
the source returning the correct error code, just as a precaution.
Change-Id: Iaefcd57a545ec3ce4ec0b8d4220bdf41377ff798
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r-- | media/libstagefright/MediaCodec.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp index 7f7c7fa..c6ba76e 100644 --- a/media/libstagefright/MediaCodec.cpp +++ b/media/libstagefright/MediaCodec.cpp @@ -871,6 +871,8 @@ status_t MediaCodec::getBufferAndFormat( } *format = info.mFormat; } + } else { + return BAD_INDEX; } return OK; } |