From f1bebdb8861e153f47ac413f4c550a8d6d72942d Mon Sep 17 00:00:00 2001 From: phintuka Date: Sun, 16 May 2010 11:53:32 +0000 Subject: check_for_scaling(): check if output dimensions are sane --- xine/vo_osdscaler.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xine/vo_osdscaler.c b/xine/vo_osdscaler.c index f0c28135..881f3ef6 100644 --- a/xine/vo_osdscaler.c +++ b/xine/vo_osdscaler.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: vo_osdscaler.c,v 1.7 2010-03-13 22:31:12 phintuka Exp $ + * $Id: vo_osdscaler.c,v 1.8 2010-05-16 11:53:32 phintuka Exp $ * */ @@ -279,10 +279,15 @@ static int check_for_scaling(osdscaler_hook_t *this, vo_frame_t *frame, vo_overl if (frame->crop_right > 0) this->output_width -= frame->crop_right; } + if (this->output_width < 128 || this->output_height < 128) { + LOGMSG("invalid output dimensions: %dx%d", this->output_width, this->output_height); + return 0; + } + /* check if scaling should be done */ if (ABS(this->output_width - extent_width) > extent_width /20 || ABS(this->output_height - extent_height) > extent_height/20 ) { - LOGOSD("scaling required"); + LOGOSD("scaling required to %dx%d", this->output_width, this->output_height); this->factor_x = 0x10000 * this->output_width / extent_width; this->factor_y = 0x10000 * this->output_height / extent_height; return 1; -- cgit v1.2.3