diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2006-09-26 02:36:55 +0000 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2006-09-26 02:36:55 +0000 |
commit | 4a4a496f6baeb0f6d551409ef6d68e02e6e8cf4e (patch) | |
tree | cae5460ce39ea392b7af940125650b0576e09af1 | |
parent | cc1db729f6f45eeacae986df44f11d450d06f731 (diff) | |
download | xine-lib-4a4a496f6baeb0f6d551409ef6d68e02e6e8cf4e.tar.gz xine-lib-4a4a496f6baeb0f6d551409ef6d68e02e6e8cf4e.tar.bz2 |
Assert presence of this->renderer as the whole function relies on its presence.
To avoid segmentation fault, also return if the renderer isn't found.
CVS patchset: 8286
CVS date: 2006/09/26 02:36:55
-rw-r--r-- | src/libsputext/xine_decoder.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libsputext/xine_decoder.c b/src/libsputext/xine_decoder.c index fb0251812..851a9af93 100644 --- a/src/libsputext/xine_decoder.c +++ b/src/libsputext/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.95 2006/07/10 22:08:30 dgp85 Exp $ + * $Id: xine_decoder.c,v 1.96 2006/09/26 02:36:55 dgp85 Exp $ * */ @@ -339,13 +339,16 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su int line, y; int font_size; + _x_assert(this->renderer != NULL); + if ( ! this->renderer ) + return; + update_font_size(this, 0); if( strcmp(this->font, this->class->font) ) { strncpy(this->font, this->class->font, FONTNAME_SIZE); this->font[FONTNAME_SIZE - 1] = '\0'; - if( this->renderer ) - this->renderer->set_font (this->osd, this->class->font, this->font_size); + this->renderer->set_font (this->osd, this->class->font, this->font_size); } font_size = this->font_size; |