From a9936de38427082a22c9d5953c6aff05b548ee67 Mon Sep 17 00:00:00 2001 From: Johann Date: Fri, 10 Jun 2016 17:54:33 -0700 Subject: [PATCH] Use data size directly instead of recomputing. Cleans warning in Android build: comparison of integers of different signs: 'unsigned int' and 'int' int n = (int)VPXMIN(sizeof(clear_buffer), data_end - data); ^ ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ Change-Id: I964355ceae6b39e22c0196294b25e28387f84945 --- vp8/decoder/decodeframe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vp8/decoder/decodeframe.c b/vp8/decoder/decodeframe.c index 4bc87eb13..566972ea7 100644 --- a/vp8/decoder/decodeframe.c +++ b/vp8/decoder/decodeframe.c @@ -986,7 +986,8 @@ int vp8_decode_frame(VP8D_COMP *pbi) VP8_COMMON *const pc = &pbi->common; MACROBLOCKD *const xd = &pbi->mb; const unsigned char *data = pbi->fragments.ptrs[0]; - const unsigned char *data_end = data + pbi->fragments.sizes[0]; + const unsigned int data_sz = pbi->fragments.sizes[0]; + const unsigned char *data_end = data + data_sz; ptrdiff_t first_partition_length_in_bytes; int i, j, k, l; @@ -1022,7 +1023,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) const unsigned char *clear = data; if (pbi->decrypt_cb) { - int n = (int)VPXMIN(sizeof(clear_buffer), data_end - data); + int n = (int)VPXMIN(sizeof(clear_buffer), data_sz); pbi->decrypt_cb(pbi->decrypt_state, data, clear_buffer, n); clear = clear_buffer; }