shithub: libvpx

Download patch

ref: a9936de38427082a22c9d5953c6aff05b548ee67
parent: 95d29675b2592bb7161f3159d4f8dc338fe13bae
author: Johann <[email protected]>
date: Fri Jun 10 13:54:33 EDT 2016

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

--- a/vp8/decoder/decodeframe.c
+++ b/vp8/decoder/decodeframe.c
@@ -986,7 +986,8 @@
     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 @@
         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;
         }