Skip to content

Commit

Permalink
[rbp] fixed possible overread in texture loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
huceke committed Aug 29, 2012
1 parent 6bf5c0e commit 9cbb272
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xbmc/guilib/Texture.cpp
Expand Up @@ -268,8 +268,8 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW


if(omx_image.GetDecodedData()) if(omx_image.GetDecodedData())
{ {
int size = ( (GetPitch() * GetRows() ) < omx_image.GetDecodedSize() ) ? int size = ( ( GetPitch() * GetRows() ) > omx_image.GetDecodedSize() ) ?
GetPitch() * GetRows() : omx_image.GetDecodedSize(); omx_image.GetDecodedSize() : ( GetPitch() * GetRows() );


memcpy(m_pixels, (unsigned char *)omx_image.GetDecodedData(), size); memcpy(m_pixels, (unsigned char *)omx_image.GetDecodedData(), size);
} }
Expand Down

0 comments on commit 9cbb272

Please sign in to comment.