Skip to content

Commit a06a6f0

Browse files
committed
#5380 Guard against scaled() failure to prevent null dereference
1 parent 30f0b8c commit a06a6f0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

indra/newview/llviewertexture.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,11 @@ bool LLViewerFetchedTexture::processFetchResults(S32& desired_discard, S32 curre
19141914
//
19151915
// BOOST_ICON gets scaling because profile icons can have a bunch of different formats, not just j2c
19161916
// Might need another pass to use discard for j2c and scaling for everything else.
1917-
mRawImage = mRawImage->scaled(expected_width, expected_height);
1917+
LLPointer<LLImageRaw> scaled = mRawImage->scaled(expected_width, expected_height);
1918+
if (scaled.notNull())
1919+
{
1920+
mRawImage = scaled;
1921+
}
19181922
}
19191923
}
19201924

@@ -1929,7 +1933,11 @@ bool LLViewerFetchedTexture::processFetchResults(S32& desired_discard, S32 curre
19291933
//
19301934
// Todo: probably needs to be remade to use discard, all thumbnails are supposed to be j2c,
19311935
// so no need to scale, should be posible to use discard to scale image down.
1932-
mRawImage = mRawImage->scaled(expected_width, expected_height);
1936+
LLPointer<LLImageRaw> scaled = mRawImage->scaled(expected_width, expected_height);
1937+
if (scaled.notNull())
1938+
{
1939+
mRawImage = scaled;
1940+
}
19331941
}
19341942
}
19351943

0 commit comments

Comments
 (0)