[vlc-devel] [PATCH 2/2] mediacodec: check getOutputBuffers and getInputBuffers

Thomas Guillem thomas at gllm.fr
Fri Mar 13 09:40:48 CET 2015


---
 modules/codec/omxil/android_mediacodec.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
index 7e8bf76..114b648 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -613,7 +613,15 @@ loopclean:
 
     if (p_sys->get_input_buffers && p_sys->get_output_buffers) {
         p_sys->input_buffers = (*env)->CallObjectMethod(env, p_sys->codec, p_sys->get_input_buffers);
+        if (CHECK_EXCEPTION()) {
+            msg_Err(p_dec, "Exception in MediaCodec.getInputBuffers (OpenDecoder)");
+            goto error;
+        }
         p_sys->output_buffers = (*env)->CallObjectMethod(env, p_sys->codec, p_sys->get_output_buffers);
+        if (CHECK_EXCEPTION()) {
+            msg_Err(p_dec, "Exception in MediaCodec.getOutputBuffers (OpenDecoder)");
+            goto error;
+        }
         p_sys->input_buffers = (*env)->NewGlobalRef(env, p_sys->input_buffers);
         p_sys->output_buffers = (*env)->NewGlobalRef(env, p_sys->output_buffers);
     }
-- 
2.1.3




More information about the vlc-devel mailing list