Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[fix] - workaround for swscale crashing on images which have an uneve…

…n number of pixels in width
  • Loading branch information...
commit 88d6eed2ba770efc0b0558efef345422b085ed86 1 parent 82b31e5
Memphiz Memphiz authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 xbmc/guilib/Texture.cpp
10 xbmc/guilib/Texture.cpp
View
@@ -91,6 +91,16 @@ void CBaseTexture::Allocate(unsigned int width, unsigned int height, unsigned in
m_textureWidth = ((m_textureWidth + 3) / 4) * 4;
m_textureHeight = ((m_textureHeight + 3) / 4) * 4;
}
+ else
+ {
+ // align all textures so that they have an even width
+ // in some circumstances when we downsize a thumbnail
+ // which has an uneven number of pixels in width
+ // we crash in CPicture::ScaleImage in ffmpegs swscale
+ // because it tries to access beyond the source memory
+ // (happens on osx and ios)
+ m_textureWidth = ((m_textureWidth + 1) / 2) * 2;
+ }
// check for max texture size
#define CLAMP(x, y) { if (x > y) x = y; }
Please sign in to comment.
Something went wrong with that request. Please try again.