diff options
author | Benjamin Otte <otte@gnome.org> | 2005-01-06 20:19:04 +0000 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2005-01-06 20:19:04 +0000 |
commit | 33a8594b55017b9765f50ca44869a17439937412 (patch) | |
tree | 243f24f85c5558c928d392d66c01b3d897560675 | |
parent | 02e0b87b2b2936b284a29d6de15a6c8c97c5674e (diff) | |
download | gst-plugins-bad-33a8594b55017b9765f50ca44869a17439937412.tar.gz gst-plugins-bad-33a8594b55017b9765f50ca44869a17439937412.tar.bz2 gst-plugins-bad-33a8594b55017b9765f50ca44869a17439937412.zip |
gst/games/gstpuzzle.c: don't draw a puzzle if either width or height of tiles would be 0.
Original commit message from CVS:
* gst/games/gstpuzzle.c: (draw_puzzle):
don't draw a puzzle if either width or height of tiles would be 0.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gst/games/gstpuzzle.c | 6 |
2 files changed, 11 insertions, 0 deletions
@@ -1,5 +1,10 @@ 2005-01-06 Benjamin Otte <otte@gnome.org> + * gst/games/gstpuzzle.c: (draw_puzzle): + don't draw a puzzle if either width or height of tiles would be 0. + +2005-01-06 Benjamin Otte <otte@gnome.org> + * gst/games/gstpuzzle.c: (gst_puzzle_get_type), (gst_puzzle_class_init), (gst_puzzle_finalize): no memleaks, please diff --git a/gst/games/gstpuzzle.c b/gst/games/gstpuzzle.c index 532fa774..25e631f8 100644 --- a/gst/games/gstpuzzle.c +++ b/gst/games/gstpuzzle.c @@ -498,6 +498,12 @@ draw_puzzle (GstVideofilter * videofilter, void *destp, void *srcp) /* use multiples of 4 here to get around drawing problems with YUV colorspaces */ width = (width / puzzle->columns) & ~3; height = (height / puzzle->rows) & ~3; + if (width == 0 || height == 0) { + gst_video_image_copy_area (&dest, 0, 0, &src, 0, 0, + gst_videofilter_get_input_width (videofilter), + gst_videofilter_get_input_height (videofilter)); + return; + } if (width * puzzle->columns != gst_videofilter_get_input_width (videofilter)) { guint w = gst_videofilter_get_input_width (videofilter) - width * puzzle->columns; |