summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2017-06-06 16:06:28 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2017-06-06 16:06:28 +0300
commitd3a1c4cda49cc1b113abbdb175c557456581efac (patch)
tree94e297f0e69f052b3382737fe197de1c84bd567a /indra/newview
parentd700552b449f3c2bcaee46f61fe3290f57e58fe9 (diff)
MAINT-7462 check pointer to avoid allocation crash in llpluginclassmedia
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llviewermedia.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 9f05ee61bd..01b0dd0077 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -3052,20 +3052,23 @@ void LLViewerMediaImpl::update()
data = mMediaSource->getBitsData();
}
- // Offset the pixels pointer to match x_pos and y_pos
- data += ( x_pos * mMediaSource->getTextureDepth() * mMediaSource->getBitsWidth() );
- data += ( y_pos * mMediaSource->getTextureDepth() );
-
+ if(data != NULL)
{
- LL_RECORD_BLOCK_TIME(FTM_MEDIA_SET_SUBIMAGE);
- placeholder_image->setSubImage(
- data,
- mMediaSource->getBitsWidth(),
- mMediaSource->getBitsHeight(),
- x_pos,
- y_pos,
- width,
- height);
+ // Offset the pixels pointer to match x_pos and y_pos
+ data += ( x_pos * mMediaSource->getTextureDepth() * mMediaSource->getBitsWidth() );
+ data += ( y_pos * mMediaSource->getTextureDepth() );
+
+ {
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_SET_SUBIMAGE);
+ placeholder_image->setSubImage(
+ data,
+ mMediaSource->getBitsWidth(),
+ mMediaSource->getBitsHeight(),
+ x_pos,
+ y_pos,
+ width,
+ height);
+ }
}
}