rtmpproto: Avoid using uninitialized memory

If the url ends with .flv, we stripped it but didn't initialize
rt->playpath, doing av_strlcat on an uninitialized buffer.

Signed-off-by: Martin Storsjö <martin@martin.st>
pull/54/head
Martin Storsjö 11 years ago
parent d01e684186
commit 24eb3c7916
  1. 4
      libavformat/rtmpproto.c

@ -2510,9 +2510,9 @@ reconnect:
(!strcmp(fname + len - 4, ".f4v") ||
!strcmp(fname + len - 4, ".mp4"))) {
memcpy(rt->playpath, "mp4:", 5);
} else if (len >= 4 && !strcmp(fname + len - 4, ".flv")) {
fname[len - 4] = '\0';
} else {
if (len >= 4 && !strcmp(fname + len - 4, ".flv"))
fname[len - 4] = '\0';
rt->playpath[0] = 0;
}
av_strlcat(rt->playpath, fname, PLAYPATH_MAX_LENGTH);

Loading…
Cancel
Save