diff options
Diffstat (limited to 'src/spu_dec')
| -rw-r--r-- | src/spu_dec/sputext_demuxer.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/spu_dec/sputext_demuxer.c b/src/spu_dec/sputext_demuxer.c index d7d1361b1..b70164172 100644 --- a/src/spu_dec/sputext_demuxer.c +++ b/src/spu_dec/sputext_demuxer.c @@ -263,7 +263,7 @@ static char *sub_readtext(char *source, char **dest) { } *dest= (char *)xine_xmalloc (len+1); - if (!dest) + if (!(*dest)) return ERR; strncpy(*dest, source, len); @@ -544,6 +544,8 @@ static subtitle_t *sub_read_line_ssa(demux_sputext_t *this,subtitle_t *current) line3) < 9 ); line2=strchr(line3, ','); + if (!line2) + return NULL; for (comma = 4; comma < max_comma; comma ++) { @@ -895,7 +897,10 @@ static subtitle_t *sub_read_line_jacobsub(demux_sputext_t *this, subtitle_t *cur } } *q = '\0'; - current->text[current->lines] = strdup(line1); + if (current->lines < SUB_MAX_TEXT) + current->text[current->lines] = strdup(line1); + else + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n"); } current->lines++; return current; |
