summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin KAY <komadori@users.sourceforge.net>2003-08-08 16:22:12 +0000
committerRobin KAY <komadori@users.sourceforge.net>2003-08-08 16:22:12 +0000
commit2ec31e5af87262e67cdd5b5e420b80194390795d (patch)
tree288c9b76b0754f540b711fca5a4a8ab481e2f6f3
parent53dfa28d4d119175ac065eb12814fcb95cae11c9 (diff)
downloadxine-lib-2ec31e5af87262e67cdd5b5e420b80194390795d.tar.gz
xine-lib-2ec31e5af87262e67cdd5b5e420b80194390795d.tar.bz2
Fix segmentation fault caused by closing a conversion descriptor when none was opened.
CVS patchset: 5259 CVS date: 2003/08/08 16:22:12
-rw-r--r--src/xine-engine/osd.c6
1 files changed, 4 insertions, 2 deletions
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);