stream_selection can be freed in the fail case, in which case it's unassigned.
authorZhentan Feng <spyfeng@gmail.com>
Sat, 28 Aug 2010 23:55:26 +0000 (23:55 +0000)
committerRonald S. Bultje <rsbultje@gmail.com>
Sat, 28 Aug 2010 23:55:26 +0000 (23:55 +0000)
Therefore, init it with NULL to prevent a crash on invalid streams.

Patch by Zhentan Feng <spyfeng gmail com>.

Originally committed as revision 24960 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mmsh.c

index 5a74d9b..4214b0e 100644 (file)
@@ -214,7 +214,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
 {
     int i, port, err;
     char httpname[256], path[256], host[128], location[1024];
-    char *stream_selection;
+    char *stream_selection = NULL;
     char headers[1024];
     MMSHContext *mmsh;
     MMSContext *mms;