From 7c6898051e486459caff8a43ed642e1bb119b767 Mon Sep 17 00:00:00 2001 From: Vikas Arora Date: Mon, 11 Jun 2012 12:26:19 +0530 Subject: [PATCH] Fix asserts in Palette and BackwardReference code. Fix inequality assertion on number of palette colors. Fix inequality assertion test in BackwardReferencesHashChainFollowChosenPath. Change-Id: Ie3242f1bbeaf96db91b839b6732ccce2634cebf3 --- src/enc/backward_references.c | 2 +- src/enc/vp8l.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/enc/backward_references.c b/src/enc/backward_references.c index 7bf10214..20e3a8ec 100644 --- a/src/enc/backward_references.c +++ b/src/enc/backward_references.c @@ -613,7 +613,7 @@ static int BackwardReferencesHashChainFollowChosenPath( ++i; } } - assert(size < refs->max_size); + assert(size <= refs->max_size); refs->size = size; ok = 1; Error: diff --git a/src/enc/vp8l.c b/src/enc/vp8l.c index f24e7c49..ca4485de 100644 --- a/src/enc/vp8l.c +++ b/src/enc/vp8l.c @@ -829,7 +829,7 @@ static WebPEncodingError ApplyPalette(VP8LBitWriter* const bw, // Save palette to bitstream. VP8LWriteBits(bw, 1, TRANSFORM_PRESENT); VP8LWriteBits(bw, 2, COLOR_INDEXING_TRANSFORM); - assert(palette_size >= 2); + assert(palette_size >= 1); VP8LWriteBits(bw, 8, palette_size - 1); for (i = palette_size - 1; i >= 1; --i) { palette[i] = VP8LSubPixels(palette[i], palette[i - 1]);