libavformat/gxf.c:141: error: Null Dereference
  pointer `st` last assigned on line 83 could be null and is dereferenced at line 141, column 13.

libavformat/gxf.c:76:1: start of procedure get_sindex()
74.  * \param format stream format identifier
75.  */
76. static int get_sindex(AVFormatContext *s, int id, int format) {
    ^
77.     int i;
78.     AVStream *st = NULL;

libavformat/gxf.c:78:5: 
76. static int get_sindex(AVFormatContext *s, int id, int format) {
77.     int i;
78.     AVStream *st = NULL;
        ^
79.     for (i = 0; i < s->nb_streams; i++) {
80.         if (s->streams[i]->id == id)

libavformat/gxf.c:79:10: 
77.     int i;
78.     AVStream *st = NULL;
79.     for (i = 0; i < s->nb_streams; i++) {
             ^
80.         if (s->streams[i]->id == id)
81.             return i;

libavformat/gxf.c:79:17: Loop condition is true. Entering loop body
77.     int i;
78.     AVStream *st = NULL;
79.     for (i = 0; i < s->nb_streams; i++) {
                    ^
80.         if (s->streams[i]->id == id)
81.             return i;

libavformat/gxf.c:80:13: Taking false branch
78.     AVStream *st = NULL;
79.     for (i = 0; i < s->nb_streams; i++) {
80.         if (s->streams[i]->id == id)
                ^
81.             return i;
82.     }

libavformat/gxf.c:79:36: 
77.     int i;
78.     AVStream *st = NULL;
79.     for (i = 0; i < s->nb_streams; i++) {
                                       ^
80.         if (s->streams[i]->id == id)
81.             return i;

libavformat/gxf.c:79:17: Loop condition is false. Leaving loop
77.     int i;
78.     AVStream *st = NULL;
79.     for (i = 0; i < s->nb_streams; i++) {
                    ^
80.         if (s->streams[i]->id == id)
81.             return i;

libavformat/gxf.c:83:5: 
81.             return i;
82.     }
83.     st = av_new_stream(s, id);
        ^
84.     switch (format) {
85.         case 3:

libavformat/utils.c:2160:1: start of procedure av_new_stream()
  2158. }
  2159. 
  2160. AVStream *av_new_stream(AVFormatContext *s, int id)
        ^
  2161. {
  2162.     AVStream *st;

libavformat/utils.c:2165:9: Taking true branch
  2163.     int i;
  2164. 
  2165.     if (s->nb_streams >= MAX_STREAMS)
                ^
  2166.         return NULL;
  2167. 

libavformat/utils.c:2166:9: 
  2164. 
  2165.     if (s->nb_streams >= MAX_STREAMS)
  2166.         return NULL;
                ^
  2167. 
  2168.     st = av_mallocz(sizeof(AVStream));

libavformat/utils.c:2192:1: return from a call to av_new_stream
  2190.     s->streams[s->nb_streams++] = st;
  2191.     return st;
  2192. }
        ^
  2193. 
  2194. AVProgram *av_new_program(AVFormatContext *ac, int id)

libavformat/gxf.c:84:5: 
82.     }
83.     st = av_new_stream(s, id);
84.     switch (format) {
        ^
85.         case 3:
86.         case 4:

libavformat/gxf.c:85:9: Switch condition is false. Skipping switch case
83.     st = av_new_stream(s, id);
84.     switch (format) {
85.         case 3:
            ^
86.         case 4:
87.             st->codec->codec_type = CODEC_TYPE_VIDEO;

libavformat/gxf.c:86:9: Switch condition is false. Skipping switch case
84.     switch (format) {
85.         case 3:
86.         case 4:
            ^
87.             st->codec->codec_type = CODEC_TYPE_VIDEO;
88.             st->codec->codec_id = CODEC_ID_MJPEG;

libavformat/gxf.c:90:9: Switch condition is false. Skipping switch case
88.             st->codec->codec_id = CODEC_ID_MJPEG;
89.             break;
90.         case 13:
            ^
91.         case 15:
92.             st->codec->codec_type = CODEC_TYPE_VIDEO;

libavformat/gxf.c:91:9: Switch condition is false. Skipping switch case
89.             break;
90.         case 13:
91.         case 15:
            ^
92.             st->codec->codec_type = CODEC_TYPE_VIDEO;
93.             st->codec->codec_id = CODEC_ID_DVVIDEO;

libavformat/gxf.c:95:9: Switch condition is false. Skipping switch case
93.             st->codec->codec_id = CODEC_ID_DVVIDEO;
94.             break;
95.         case 14:
            ^
96.         case 16:
97.             st->codec->codec_type = CODEC_TYPE_VIDEO;

libavformat/gxf.c:96:9: Switch condition is false. Skipping switch case
94.             break;
95.         case 14:
96.         case 16:
            ^
97.             st->codec->codec_type = CODEC_TYPE_VIDEO;
98.             st->codec->codec_id = CODEC_ID_DVVIDEO;

libavformat/gxf.c:100:9: Switch condition is false. Skipping switch case
 98.             st->codec->codec_id = CODEC_ID_DVVIDEO;
 99.             break;
100.         case 11:
             ^
101.         case 12:
102.         case 20:

libavformat/gxf.c:101:9: Switch condition is false. Skipping switch case
 99.             break;
100.         case 11:
101.         case 12:
             ^
102.         case 20:
103.             st->codec->codec_type = CODEC_TYPE_VIDEO;

libavformat/gxf.c:102:9: Switch condition is false. Skipping switch case
100.         case 11:
101.         case 12:
102.         case 20:
             ^
103.             st->codec->codec_type = CODEC_TYPE_VIDEO;
104.             st->codec->codec_id = CODEC_ID_MPEG2VIDEO;

libavformat/gxf.c:107:9: Switch condition is false. Skipping switch case
105.             st->need_parsing = AVSTREAM_PARSE_HEADERS; //get keyframe flag etc.
106.             break;
107.         case 22:
             ^
108.         case 23:
109.             st->codec->codec_type = CODEC_TYPE_VIDEO;

libavformat/gxf.c:108:9: Switch condition is false. Skipping switch case
106.             break;
107.         case 22:
108.         case 23:
             ^
109.             st->codec->codec_type = CODEC_TYPE_VIDEO;
110.             st->codec->codec_id = CODEC_ID_MPEG1VIDEO;

libavformat/gxf.c:113:9: Switch condition is false. Skipping switch case
111.             st->need_parsing = AVSTREAM_PARSE_HEADERS; //get keyframe flag etc.
112.             break;
113.         case 9:
             ^
114.             st->codec->codec_type = CODEC_TYPE_AUDIO;
115.             st->codec->codec_id = CODEC_ID_PCM_S24LE;

libavformat/gxf.c:122:9: Switch condition is false. Skipping switch case
120.             st->codec->bits_per_sample = 24;
121.             break;
122.         case 10:
             ^
123.             st->codec->codec_type = CODEC_TYPE_AUDIO;
124.             st->codec->codec_id = CODEC_ID_PCM_S16LE;

libavformat/gxf.c:131:9: Switch condition is false. Skipping switch case
129.             st->codec->bits_per_sample = 16;
130.             break;
131.         case 17:
             ^
132.             st->codec->codec_type = CODEC_TYPE_AUDIO;
133.             st->codec->codec_id = CODEC_ID_AC3;

libavformat/gxf.c:138:9: Switch condition is true. Entering switch case
136.             break;
137.         // timecode tracks:
138.         case 7:
             ^
139.         case 8:
140.         case 24:

libavformat/gxf.c:141:13: 
139.         case 8:
140.         case 24:
141.             st->codec->codec_type = CODEC_TYPE_DATA;
                 ^
142.             st->codec->codec_id = CODEC_ID_NONE;
143.             break;
