Permalink
Browse files

[rbp] fixed possible overread in texture loading.

  • Loading branch information...
1 parent 6bf5c0e commit 9cbb2729a43c4a196b60c87acc33d8c890c4054a @huceke committed Aug 29, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 xbmc/guilib/Texture.cpp
View
@@ -268,8 +268,8 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW
if(omx_image.GetDecodedData())
{
- int size = ( (GetPitch() * GetRows() ) < omx_image.GetDecodedSize() ) ?
- GetPitch() * GetRows() : omx_image.GetDecodedSize();
+ int size = ( ( GetPitch() * GetRows() ) > omx_image.GetDecodedSize() ) ?
+ omx_image.GetDecodedSize() : ( GetPitch() * GetRows() );
memcpy(m_pixels, (unsigned char *)omx_image.GetDecodedData(), size);
}

0 comments on commit 9cbb272

Please sign in to comment.