[vlc-devel] [PATCH 2/2] mediacodec: fix comparison between signed and unsigned warning
Thomas Guillem
tom at gllm.fr
Tue Oct 14 12:22:04 CEST 2014
---
modules/codec/omxil/android_mediacodec.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
index 4977a2f..44184c6 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -988,7 +988,12 @@ static picture_t *DecodeVideo(decoder_t *p_dec, block_t **pp_block)
jobject buf = (*env)->GetObjectArrayElement(env, p_sys->input_buffers, index);
jsize size = (*env)->GetDirectBufferCapacity(env, buf);
uint8_t *bufptr = (*env)->GetDirectBufferAddress(env, buf);
- if (size > p_block->i_buffer)
+ if (size < 0) {
+ msg_Err(p_dec, "Java buffer has invalid size");
+ p_sys->error_state = true;
+ break;
+ }
+ if ((size_t) size > p_block->i_buffer)
size = p_block->i_buffer;
memcpy(bufptr, p_block->p_buffer, size);
--
2.1.0
More information about the vlc-devel
mailing list