mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 07:22:52 +01:00
Sanity check for underflow
Change-Id: I52dbdcbd02c344c6260f196afad30005d14d3ee0
This commit is contained in:
parent
8498f4bfe2
commit
d78a82c407
@ -74,6 +74,7 @@ WebPFrameCache* WebPFrameCacheNew(size_t kmin, size_t kmax) {
|
|||||||
cache->kmin = kmin;
|
cache->kmin = kmin;
|
||||||
cache->kmax = kmax;
|
cache->kmax = kmax;
|
||||||
cache->count_since_key_frame = 0;
|
cache->count_since_key_frame = 0;
|
||||||
|
assert(kmax > kmin);
|
||||||
cache->size = kmax - kmin;
|
cache->size = kmax - kmin;
|
||||||
cache->encoded_frames =
|
cache->encoded_frames =
|
||||||
(EncodedFrame*)calloc(cache->size, sizeof(*cache->encoded_frames));
|
(EncodedFrame*)calloc(cache->size, sizeof(*cache->encoded_frames));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user