]> granicus.if.org Git - libvpx/commitdiff
palette: Fix an illegal read
authorAlex Converse <aconverse@google.com>
Mon, 16 Mar 2015 23:47:38 +0000 (16:47 -0700)
committerAlex Converse <aconverse@google.com>
Tue, 17 Mar 2015 00:13:15 +0000 (17:13 -0700)
Change-Id: I71649f0a85d98b96efd08c8a9e3ee7372fd7d327

vp9/common/vp9_palette.c

index 24996843feb59647b9e510ebe33b5e84999c5457..e303619ab3e6bda250a9f4cea29446126e437486 100644 (file)
@@ -71,7 +71,7 @@ int run_lengh_encoding(uint8_t *seq, int n, uint16_t *runs, int max_run) {
     runs[l++] = symbol;
     this_run = 1;
     i++;
-    while (seq[i] == symbol && i < n) {
+    while (i < n && seq[i] == symbol) {
       i++;
       this_run++;
     }