libavformat/dv.c:402: error: Null Dereference
  pointer `sys` last assigned on line 398 could be null and is dereferenced at line 402, column 40.

libavformat/dv.c:394:1: start of procedure dv_frame_offset()
392. }
393. 
394. static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
     ^
395.                                int64_t timestamp, int flags)
396. {

libavformat/dv.c:398:5: 
396. {
397.     // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
398.     const AVDVProfile *sys = av_dv_codec_profile(c->vst->codec->width, c->vst->codec->height,
         ^
399.                                                  c->vst->codec->pix_fmt);
400.     int64_t offset;

libavcodec/dv_profile.c:287:1: start of procedure av_dv_codec_profile()
  285. }
  286. 
  287. const AVDVProfile *av_dv_codec_profile(int width, int height,
       ^
  288.                                        enum AVPixelFormat pix_fmt)
  289. {

libavcodec/dv_profile.c:293:10: 
  291.     int i;
  292. 
  293.     for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++)
                ^
  294.         if (height  == dv_profiles[i].height  &&
  295.             pix_fmt == dv_profiles[i].pix_fmt &&

libavcodec/dv_profile.c:293:17: Loop condition is true. Entering loop body
  291.     int i;
  292. 
  293.     for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++)
                       ^
  294.         if (height  == dv_profiles[i].height  &&
  295.             pix_fmt == dv_profiles[i].pix_fmt &&

libavcodec/dv_profile.c:294:13: Taking false branch
  292. 
  293.     for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++)
  294.         if (height  == dv_profiles[i].height  &&
                   ^
  295.             pix_fmt == dv_profiles[i].pix_fmt &&
  296.             width   == dv_profiles[i].width)

libavcodec/dv_profile.c:293:50: 
  291.     int i;
  292. 
  293.     for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++)
                                                        ^
  294.         if (height  == dv_profiles[i].height  &&
  295.             pix_fmt == dv_profiles[i].pix_fmt &&

libavcodec/dv_profile.c:293:17: Loop condition is false. Leaving loop
  291.     int i;
  292. 
  293.     for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++)
                       ^
  294.         if (height  == dv_profiles[i].height  &&
  295.             pix_fmt == dv_profiles[i].pix_fmt &&

libavcodec/dv_profile.c:300:5: 
  298. #endif
  299. 
  300.     return NULL;
           ^
  301. }

libavcodec/dv_profile.c:301:1: return from a call to av_dv_codec_profile
  299. 
  300.     return NULL;
  301. }
       ^

libavformat/dv.c:401:5: 
399.                                                  c->vst->codec->pix_fmt);
400.     int64_t offset;
401.     int64_t size       = avio_size(s->pb) - s->internal->data_offset;
         ^
402.     int64_t max_offset = ((size - 1) / sys->frame_size) * sys->frame_size;
403. 

libavformat/aviobuf.c:241:1: start of procedure avio_size()
  239. }
  240. 
  241. int64_t avio_size(AVIOContext *s)
       ^
  242. {
  243.     int64_t size;

libavformat/aviobuf.c:245:10: Taking false branch
  243.     int64_t size;
  244. 
  245.     if (!s)
                ^
  246.         return AVERROR(EINVAL);
  247. 

libavformat/aviobuf.c:248:10: Taking false branch
  246.         return AVERROR(EINVAL);
  247. 
  248.     if (!s->seek)
                ^
  249.         return AVERROR(ENOSYS);
  250.     size = s->seek(s->opaque, 0, AVSEEK_SIZE);

libavformat/aviobuf.c:250:5: Skipping __function_pointer__(): unresolved function pointer
  248.     if (!s->seek)
  249.         return AVERROR(ENOSYS);
  250.     size = s->seek(s->opaque, 0, AVSEEK_SIZE);
           ^
  251.     if (size < 0) {
  252.         if ((size = s->seek(s->opaque, -1, SEEK_END)) < 0)

libavformat/aviobuf.c:251:9: Taking false branch
  249.         return AVERROR(ENOSYS);
  250.     size = s->seek(s->opaque, 0, AVSEEK_SIZE);
  251.     if (size < 0) {
               ^
  252.         if ((size = s->seek(s->opaque, -1, SEEK_END)) < 0)
  253.             return size;

libavformat/aviobuf.c:257:5: 
  255.         s->seek(s->opaque, s->pos, SEEK_SET);
  256.     }
  257.     return size;
           ^
  258. }
  259. 

libavformat/aviobuf.c:258:1: return from a call to avio_size
  256.     }
  257.     return size;
  258. }
       ^
  259. 
  260. void avio_wl32(AVIOContext *s, unsigned int val)

libavformat/dv.c:402:5: 
400.     int64_t offset;
401.     int64_t size       = avio_size(s->pb) - s->internal->data_offset;
402.     int64_t max_offset = ((size - 1) / sys->frame_size) * sys->frame_size;
         ^
403. 
404.     offset = sys->frame_size * timestamp;
