Skip to content

Commit

Permalink
Fix cache indexing out-of-bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Player01osu committed Nov 18, 2024
1 parent 3a0fd63 commit 303b5c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fetcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static void cache_trim(struct image_cache* cache, size_t size)
if (size == 0) {
cache_reset(cache);
} else {
for (size_t i = cache->capacity - 1; i > size; ++i) {
for (size_t i = cache->capacity - 1; i > size; --i) {
image_free(cache->queue[i]);
cache->queue[i] = NULL;
}
Expand Down

0 comments on commit 303b5c5

Please sign in to comment.