From 2ec31e5af87262e67cdd5b5e420b80194390795d Mon Sep 17 00:00:00 2001 From: Robin KAY Date: Fri, 8 Aug 2003 16:22:12 +0000 Subject: Fix segmentation fault caused by closing a conversion descriptor when none was opened. CVS patchset: 5259 CVS date: 2003/08/08 16:22:12 --- src/xine-engine/osd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index 8c84097d6..f7e7c3e1d 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -746,7 +746,7 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1, osd_font_t *font; int i, y; uint8_t *dst, *src; - char *inbuf; + const char *inbuf; uint16_t unicode; size_t inbytesleft; @@ -932,7 +932,9 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1, } #ifndef _MSC_VER - iconv_close(cd); + if (cd != (iconv_t)-1) { + iconv_close(cd); + } #endif /* _MSC_VER */ pthread_mutex_unlock (&this->osd_mutex); -- cgit v1.2.3