From 85ad714b38516807efe40d67da406208d72b0dd0 Mon Sep 17 00:00:00 2001 From: Shalaj Jain Date: Wed, 21 Oct 2015 19:01:59 -0700 Subject: 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 --- media/libstagefright/MediaCodec.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'media/libstagefright/MediaCodec.cpp') 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; } -- cgit v1.1