Skip to content

Commit

Permalink
ensure we don't try crazy dimensions
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@5192 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jan 15, 2014
1 parent a81aa40 commit 5fd4896
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/xpra/server/window_video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ def setup_pipeline(self, scores, width, height, src_format):
we try to create a working pipeline, trying each option
until one succeeds.
"""
assert width>0 and height>0, "invalid dimensions: %sx%s" % (width, height)
start = time.time()
debug("setup_pipeline%s", (scores, width, height, src_format))
for option in scores:
Expand Down Expand Up @@ -658,6 +659,9 @@ def setup_pipeline(self, scores, width, height, src_format):
if encoder_scaling!=(1,1) and not encoder_spec.can_scale:
debug("scaling is now enabled, so skipping %s", encoder_spec)
continue
if width<=0 or height<=0:
#log.warn("skipping invalid dimensions..")
continue
enc_start = time.time()
self._video_encoder = encoder_spec.codec_class()
self._video_encoder.init_context(enc_width, enc_height, enc_in_format, encoder_spec.encoding, quality, speed, encoder_scaling, self.encoding_options)
Expand Down

0 comments on commit 5fd4896

Please sign in to comment.