Skip to content

Commit

Permalink
#3359 reject odd widths rather than crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Oct 27, 2022
1 parent 1026918 commit 91fdd9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xpra/codecs/enc_x264/encoder.pyx
Expand Up @@ -501,6 +501,8 @@ cdef class Encoder:
assert encoding=="h264", "invalid encoding: %s" % encoding
assert options.get("scaled-width", width)==width, "x264 encoder does not handle scaling"
assert options.get("scaled-height", height)==height, "x264 encoder does not handle scaling"
if width%2!=0 and src_format not in ("BGRX", "YUV444P"):
raise ValueError(f"invalid odd width {width} for {src_format}")
self.width = width
self.height = height
self.quality = options.intget("quality", 50)
Expand Down

0 comments on commit 91fdd9b

Please sign in to comment.