diff --git a/libavformat/segment.c b/libavformat/segment.c index e4c919f60d..80716bcf90 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -99,8 +99,8 @@ static int seg_write_header(AVFormatContext *s) if (!seg->path) { char *t; seg->path = av_strdup(s->filename); - t = rindex(seg->path, '.'); - if (t) t = '\0'; + t = strrchr(seg->path, '.'); + if (t) *t = '\0'; } oc = avformat_alloc_context();