Skip to content

Commit

Permalink
mipmap_cache.c: Fix crash when called with DT_MIPMAP_PREFETCH.
Browse files Browse the repository at this point in the history
In this case buf is null.
  • Loading branch information
TurboGit committed Aug 31, 2024
1 parent b85a45f commit 23119b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/common/mipmap_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,11 @@ void dt_mipmap_cache_get_with_caller(
int line)
{
const uint32_t key = get_key(imgid, mip);
buf->loader_status = DT_IMAGEIO_OK;

// buf may be null when called with DT_MIPMAP_PREFETCH for example
if(buf)
buf->loader_status = DT_IMAGEIO_OK;

if(flags == DT_MIPMAP_TESTLOCK)
{
// simple case: only get and lock if it's there.
Expand Down

0 comments on commit 23119b2

Please sign in to comment.