summaryrefslogtreecommitdiff
path: root/xine
diff options
context:
space:
mode:
Diffstat (limited to 'xine')
-rw-r--r--xine/vo_osdscaler.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/xine/vo_osdscaler.c b/xine/vo_osdscaler.c
index ee29a7da..21cb0935 100644
--- a/xine/vo_osdscaler.c
+++ b/xine/vo_osdscaler.c
@@ -4,13 +4,14 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: vo_osdscaler.c,v 1.5 2010-01-17 21:04:26 phintuka Exp $
+ * $Id: vo_osdscaler.c,v 1.6 2010-02-22 12:50:20 phintuka Exp $
*
*/
#include <stdlib.h>
#include <xine/video_out.h>
+#include <xine/xine_internal.h>
#ifdef SWBLEND
# include <xine/alphablend.h>
#endif
@@ -218,11 +219,18 @@ static void osdscaler_overlay_begin (vo_driver_t *self, vo_frame_t *frame, int c
static int check_for_scaling(osdscaler_hook_t *this, vo_frame_t *frame, vo_overlay_t *overlay)
{
+ int extent_width, extent_height;
+
this->x_move = this->y_move = 0;
if (!this->enable)
return 0;
+ if (!overlay->rle)
+ return 0;
+ if (!frame->stream || frame->stream == XINE_ANON_STREAM)
+ return 0;
+
/* check for VDR OSD */
if (overlay->hili_rgb_clut != VDR_OSD_MAGIC /* not from vdr */) {
LOGOSD("overlay: source not VDR");
@@ -231,8 +239,8 @@ static int check_for_scaling(osdscaler_hook_t *this, vo_frame_t *frame, vo_overl
/* VDR input plugin stores some control data in hili clut area */
vdr_osd_extradata_t *data = (vdr_osd_extradata_t *)overlay->hili_color;
- int extent_width = data->extent_width;
- int extent_height = data->extent_height;
+ extent_width = data->extent_width;
+ extent_height = data->extent_height;
if (!data->scaling)
return 0;
@@ -250,6 +258,11 @@ static int check_for_scaling(osdscaler_hook_t *this, vo_frame_t *frame, vo_overl
# endif
#endif
+ if (extent_width < 128 || extent_height < 128) {
+ LOGOSD("overlay: invalid extent size %dx%d", extent_width, extent_height);
+ return 0;
+ }
+
/* detect output size */
if (overlay->unscaled && this->unscaled_supported) {
this->output_width = vo_def_get_property((vo_driver_t*)this, VO_PROP_WINDOW_WIDTH);