Sanity check for underflow

Change-Id: I52dbdcbd02c344c6260f196afad30005d14d3ee0
This commit is contained in:
Urvang Joshi 2013-09-16 13:35:13 -07:00
parent 8498f4bfe2
commit d78a82c407

View File

@ -74,6 +74,7 @@ WebPFrameCache* WebPFrameCacheNew(size_t kmin, size_t kmax) {
cache->kmin = kmin;
cache->kmax = kmax;
cache->count_since_key_frame = 0;
assert(kmax > kmin);
cache->size = kmax - kmin;
cache->encoded_frames =
(EncodedFrame*)calloc(cache->size, sizeof(*cache->encoded_frames));