Skip to content

Commit

Permalink
* fix crash when stride is not set
Browse files Browse the repository at this point in the history
* more generic test for alpha from pixel format string

git-svn-id: https://xpra.org/svn/Xpra/trunk@6529 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 22, 2014
1 parent 0642e8a commit 6060b86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xpra/server/picture_encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def warn_encoding_once(key, message):
def webp_encode(coding, image, supports_transparency, quality, speed, options):
stride = image.get_rowstride()
enc_webp = get_codec("enc_webp")
if enc_webp and stride%4==0 and image.get_pixel_format() in ("BGRA", "BGRX"):
if enc_webp and stride>0 and stride%4==0 and image.get_pixel_format() in ("BGRA", "BGRX"):
#prefer Cython module:
alpha = supports_transparency and image.get_pixel_format()=="BGRA"
alpha = supports_transparency and image.get_pixel_format().find("A")>=0
w = image.get_width()
h = image.get_height()
if quality==100:
Expand Down

0 comments on commit 6060b86

Please sign in to comment.