diff options
author | Bastien Nocera <hadess@users.sourceforge.net> | 2003-12-09 23:55:11 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@users.sourceforge.net> | 2003-12-09 23:55:11 +0000 |
commit | 31aa4a19da2de6bf3299d64a73bc2a1d39a0474a (patch) | |
tree | 48ae1839989816e7460bb3bc80e4f54875406975 /src | |
parent | 6f45ec9cb3f48dbd82432fe09a47714182bc6530 (diff) | |
download | xine-lib-31aa4a19da2de6bf3299d64a73bc2a1d39a0474a.tar.gz xine-lib-31aa4a19da2de6bf3299d64a73bc2a1d39a0474a.tar.bz2 |
Fix crash with really long subtitle/language names in ogm/off files
Fixes playback of http://www.lysator.liu.se/~philip/sample.ogg
Front-ends should be using XINE_LANG_LABEL_MAX_SIZE as the max size for
language/subtitle labels
CVS patchset: 5882
CVS date: 2003/12/09 23:55:11
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_ogg.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index daadead45..fd68d0a89 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_ogg.c,v 1.122 2003/12/05 15:54:57 f1rmb Exp $ + * $Id: demux_ogg.c,v 1.123 2003/12/09 23:55:11 hadess Exp $ * * demultiplexer for ogg streams * @@ -615,7 +615,7 @@ static void send_ogg_buf (demux_ogg_t *this, if (chapter >= 0) { char t_title[256]; - sprintf(t_title, "%s / %s", this->title, this->chapter_info->entries[chapter].name); + snprintf(t_title, sizeof (t_title), "%s / %s", this->title, this->chapter_info->entries[chapter].name); title = t_title; } else { title = this->title; @@ -1585,10 +1585,10 @@ static int demux_ogg_get_optional_data(demux_plugin_t *this_gen, for (stream_num=0; stream_num<this->num_streams; stream_num++) { if (this->buf_types[stream_num]==BUF_SPU_OGM+channel) { if (this->language[stream_num]) { - sprintf(str, "%s", this->language[stream_num]); + strncpy (str, this->language[stream_num], XINE_LANG_LABEL_MAX_SIZE); return DEMUX_OPTIONAL_SUCCESS; } else { - sprintf(str, "channel %d",channel); + snprintf(str, XINE_LANG_LABEL_MAX_SIZE, "channel %d",channel); return DEMUX_OPTIONAL_SUCCESS; } } @@ -1604,10 +1604,10 @@ static int demux_ogg_get_optional_data(demux_plugin_t *this_gen, for (stream_num=0; stream_num<this->num_streams; stream_num++) { if ((this->buf_types[stream_num]&0xFF00001F)==BUF_AUDIO_BASE+channel) { if (this->language[stream_num]) { - sprintf(str, "%s", this->language[stream_num]); + strncpy (str, this->language[stream_num], XINE_LANG_LABEL_MAX_SIZE); return DEMUX_OPTIONAL_SUCCESS; } else { - sprintf(str, "channel %d",channel); + snprintf(str, XINE_LANG_LABEL_MAX_SIZE, "channel %d",channel); return DEMUX_OPTIONAL_SUCCESS; } } |