Skip to content

Commit

Permalink
[guilib] The output buffer of IImage::Decode should be a const pointe…
Browse files Browse the repository at this point in the history
…r rather than a pointer to a const value.
  • Loading branch information
ace20022 committed Sep 7, 2015
1 parent ccae6f4 commit 57ace89
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion xbmc/guilib/JpegIO.cpp
Expand Up @@ -340,7 +340,7 @@ bool CJpegIO::Read(unsigned char* buffer, unsigned int bufSize, unsigned int min
}
}

bool CJpegIO::Decode(const unsigned char *pixels, unsigned int pitch, unsigned int format)
bool CJpegIO::Decode(unsigned char* const pixels, unsigned int pitch, unsigned int format)
{
unsigned char *dst = (unsigned char*)pixels;

Expand Down
2 changes: 1 addition & 1 deletion xbmc/guilib/JpegIO.h
Expand Up @@ -42,7 +42,7 @@ class CJpegIO : public IImage
static bool CreateThumbnailFromSurface(unsigned char* buffer, unsigned int width, unsigned int height, unsigned int format, unsigned int pitch, const std::string& destFile);
void Close();
// methods for the imagefactory
virtual bool Decode(const unsigned char *pixels, unsigned int pitch, unsigned int format);
virtual bool Decode(unsigned char* const pixels, unsigned int pitch, unsigned int format);
virtual bool LoadImageFromMemory(unsigned char* buffer, unsigned int bufSize, unsigned int width, unsigned int height);
virtual bool CreateThumbnailFromSurface(unsigned char* bufferin, unsigned int width, unsigned int height, unsigned int format, unsigned int pitch, const std::string& destFile,
unsigned char* &bufferout, unsigned int &bufferoutSize);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/guilib/cximage.cpp
Expand Up @@ -65,7 +65,7 @@ bool CXImage::LoadImageFromMemory(unsigned char* buffer, unsigned int bufSize, u
return true;
}

bool CXImage::Decode(const unsigned char *pixels, unsigned int pitch, unsigned int format)
bool CXImage::Decode(unsigned char* const pixels, unsigned int pitch, unsigned int format)
{
if (m_image.width == 0 || m_image.height == 0 || !m_dll.IsLoaded())
return false;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/guilib/cximage.h
Expand Up @@ -29,7 +29,7 @@ class CXImage : public IImage
~CXImage();

virtual bool LoadImageFromMemory(unsigned char* buffer, unsigned int bufSize, unsigned int width, unsigned int height);
virtual bool Decode(const unsigned char *pixels, unsigned int pitch, unsigned int format);
virtual bool Decode(unsigned char* const pixels, unsigned int pitch, unsigned int format);
virtual bool CreateThumbnailFromSurface(unsigned char* bufferin, unsigned int width, unsigned int height, unsigned int format, unsigned int pitch, const std::string& destFile,
unsigned char* &bufferout, unsigned int &bufferoutSize);
virtual void ReleaseThumbnailBuffer();
Expand Down
2 changes: 1 addition & 1 deletion xbmc/guilib/iimage.h
Expand Up @@ -43,7 +43,7 @@ class IImage
\param format The format of the output buffer (JpegIO only)
\return true if the image data could be decoded to the output buffer
*/
virtual bool Decode(const unsigned char *pixels, unsigned int pitch, unsigned int format)=0;
virtual bool Decode(unsigned char* const pixels, unsigned int pitch, unsigned int format)=0;
/*!
\brief Encodes an thumbnail from raw bits of given memory location
\remarks Caller need to call ReleaseThumbnailBuffer() afterwards to free the output buffer
Expand Down

0 comments on commit 57ace89

Please sign in to comment.