From b4c3c574ffd06d3e11fb7ad9c0e3cb5d458df79b Mon Sep 17 00:00:00 2001 From: phintuka Date: Sat, 30 Jan 2010 08:32:06 +0000 Subject: Fixed segfault when closing OSD (only SHOW events have event->object.overlay) --- xine_post_autocrop.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/xine_post_autocrop.c b/xine_post_autocrop.c index 3ad1f4db..28185a7b 100644 --- a/xine_post_autocrop.c +++ b/xine_post_autocrop.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_post_autocrop.c,v 1.37 2010-01-19 00:09:52 phintuka Exp $ + * $Id: xine_post_autocrop.c,v 1.38 2010-01-30 08:32:06 phintuka Exp $ * */ @@ -1454,12 +1454,14 @@ static int32_t autocrop_overlay_add_event(video_overlay_manager_t *this_gen, voi pthread_mutex_unlock(&this->crop_lock); if(cropping_active && crop_total>10) { + if (event->event_type == OVERLAY_EVENT_SHOW #ifdef VO_CAP_CUSTOM_EXTENT_OVERLAY - /* Do not move overlay if video_out has independent video and OSD resolutions */ - if (event->object.overlay->extent_width <= 0 || - event->object.overlay->extent_height <= 0) + /* Do not move overlay if video_out has independent video and OSD resolutions */ + && event->object.overlay + && ( event->object.overlay->extent_width <= 0 || + event->object.overlay->extent_height <= 0) #endif - if (event->event_type == OVERLAY_EVENT_SHOW) { + ) { switch (event->object.object_type) { case 0: /* regular subtitle */ -- cgit v1.2.3