libavformat/nutdec.c:751: error: Null Dereference
  pointer `pkt->data` last assigned on line 750 could be null and is dereferenced by call to `memcpy()` at line 751, column 5.

libavformat/nutdec.c:723:1: start of procedure decode_frame()
721. }
722. 
723. static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code){
     ^
724.     AVFormatContext *s= nut->avf;
725.     ByteIOContext *bc = s->pb;

libavformat/nutdec.c:724:5: 
722. 
723. static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code){
724.     AVFormatContext *s= nut->avf;
         ^
725.     ByteIOContext *bc = s->pb;
726.     int size, stream_id, discard;

libavformat/nutdec.c:725:5: 
723. static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code){
724.     AVFormatContext *s= nut->avf;
725.     ByteIOContext *bc = s->pb;
         ^
726.     int size, stream_id, discard;
727.     int64_t pts, last_IP_pts;

libavformat/nutdec.c:731:5: Skipping decode_frame_header(): empty list of specs
729.     uint8_t header_idx;
730. 
731.     size= decode_frame_header(nut, &pts, &stream_id, &header_idx, frame_code);
         ^
732.     if(size < 0)
733.         return -1;

libavformat/nutdec.c:732:8: Taking false branch
730. 
731.     size= decode_frame_header(nut, &pts, &stream_id, &header_idx, frame_code);
732.     if(size < 0)
            ^
733.         return -1;
734. 

libavformat/nutdec.c:735:5: 
733.         return -1;
734. 
735.     stc= &nut->stream[stream_id];
         ^
736. 
737.     if (stc->last_flags & FLAG_KEY)

libavformat/nutdec.c:737:9: Taking true branch
735.     stc= &nut->stream[stream_id];
736. 
737.     if (stc->last_flags & FLAG_KEY)
             ^
738.         stc->skip_until_key_frame=0;
739. 

libavformat/nutdec.c:738:9: 
736. 
737.     if (stc->last_flags & FLAG_KEY)
738.         stc->skip_until_key_frame=0;
             ^
739. 
740.     discard= s->streams[ stream_id ]->discard;

libavformat/nutdec.c:740:5: 
738.         stc->skip_until_key_frame=0;
739. 
740.     discard= s->streams[ stream_id ]->discard;
         ^
741.     last_IP_pts= s->streams[ stream_id ]->last_IP_pts;
742.     if(  (discard >= AVDISCARD_NONKEY && !(stc->last_flags & FLAG_KEY))

libavformat/nutdec.c:741:5: 
739. 
740.     discard= s->streams[ stream_id ]->discard;
741.     last_IP_pts= s->streams[ stream_id ]->last_IP_pts;
         ^
742.     if(  (discard >= AVDISCARD_NONKEY && !(stc->last_flags & FLAG_KEY))
743.        ||(discard >= AVDISCARD_BIDIR && last_IP_pts != AV_NOPTS_VALUE && last_IP_pts > pts)

libavformat/nutdec.c:742:11: Taking false branch
740.     discard= s->streams[ stream_id ]->discard;
741.     last_IP_pts= s->streams[ stream_id ]->last_IP_pts;
742.     if(  (discard >= AVDISCARD_NONKEY && !(stc->last_flags & FLAG_KEY))
               ^
743.        ||(discard >= AVDISCARD_BIDIR && last_IP_pts != AV_NOPTS_VALUE && last_IP_pts > pts)
744.        || discard >= AVDISCARD_ALL

libavformat/nutdec.c:743:11: Taking true branch
741.     last_IP_pts= s->streams[ stream_id ]->last_IP_pts;
742.     if(  (discard >= AVDISCARD_NONKEY && !(stc->last_flags & FLAG_KEY))
743.        ||(discard >= AVDISCARD_BIDIR && last_IP_pts != AV_NOPTS_VALUE && last_IP_pts > pts)
               ^
744.        || discard >= AVDISCARD_ALL
745.        || stc->skip_until_key_frame){

libavformat/nutdec.c:743:41: Taking true branch
741.     last_IP_pts= s->streams[ stream_id ]->last_IP_pts;
742.     if(  (discard >= AVDISCARD_NONKEY && !(stc->last_flags & FLAG_KEY))
743.        ||(discard >= AVDISCARD_BIDIR && last_IP_pts != AV_NOPTS_VALUE && last_IP_pts > pts)
                                             ^
744.        || discard >= AVDISCARD_ALL
745.        || stc->skip_until_key_frame){

libavformat/nutdec.c:743:74: Taking false branch
741.     last_IP_pts= s->streams[ stream_id ]->last_IP_pts;
742.     if(  (discard >= AVDISCARD_NONKEY && !(stc->last_flags & FLAG_KEY))
743.        ||(discard >= AVDISCARD_BIDIR && last_IP_pts != AV_NOPTS_VALUE && last_IP_pts > pts)
                                                                              ^
744.        || discard >= AVDISCARD_ALL
745.        || stc->skip_until_key_frame){

libavformat/nutdec.c:744:11: Taking false branch
742.     if(  (discard >= AVDISCARD_NONKEY && !(stc->last_flags & FLAG_KEY))
743.        ||(discard >= AVDISCARD_BIDIR && last_IP_pts != AV_NOPTS_VALUE && last_IP_pts > pts)
744.        || discard >= AVDISCARD_ALL
               ^
745.        || stc->skip_until_key_frame){
746.         url_fskip(bc, size);

libavformat/nutdec.c:745:11: Taking false branch
743.        ||(discard >= AVDISCARD_BIDIR && last_IP_pts != AV_NOPTS_VALUE && last_IP_pts > pts)
744.        || discard >= AVDISCARD_ALL
745.        || stc->skip_until_key_frame){
               ^
746.         url_fskip(bc, size);
747.         return 1;

libavformat/nutdec.c:750:5: 
748.     }
749. 
750.     av_new_packet(pkt, size + nut->header_len[header_idx]);
         ^
751.     memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
752.     pkt->pos= url_ftell(bc); //FIXME

libavcodec/avpacket.c:48:1: start of procedure av_new_packet()
  46. }
  47. 
  48. int av_new_packet(AVPacket *pkt, int size)
      ^
  49. {
  50.     uint8_t *data= NULL;

libavcodec/avpacket.c:50:5: 
  48. int av_new_packet(AVPacket *pkt, int size)
  49. {
  50.     uint8_t *data= NULL;
          ^
  51.     if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
  52.         data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);

libavcodec/avpacket.c:51:8: Taking true branch
  49. {
  50.     uint8_t *data= NULL;
  51.     if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
             ^
  52.         data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
  53.     if (data){

libavcodec/avpacket.c:52:9: 
  50.     uint8_t *data= NULL;
  51.     if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
  52.         data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
              ^
  53.     if (data){
  54.         memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);

libavutil/mem.c:47:1: start of procedure av_malloc()
    45.    linker will do it automatically. */
    46. 
    47. void *av_malloc(unsigned int size)
        ^
    48. {
    49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
    47. void *av_malloc(unsigned int size)
    48. {
    49.     void *ptr = NULL;
            ^
    50. #if CONFIG_MEMALIGN_HACK
    51.     long diff;

libavutil/mem.c:55:8: Taking true branch
    53. 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
               ^
    56.         return NULL;
    57. 

libavutil/mem.c:56:9: 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
    56.         return NULL;
                ^
    57. 
    58. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:100:1: return from a call to av_malloc
     98. #endif
     99.     return ptr;
    100. }
         ^
    101. 
    102. void *av_realloc(void *ptr, unsigned int size)

libavcodec/avpacket.c:53:9: Taking false branch
  51.     if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
  52.         data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
  53.     if (data){
              ^
  54.         memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
  55.     }else

libavcodec/avpacket.c:56:9: 
  54.         memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
  55.     }else
  56.         size=0;
              ^
  57. 
  58.     av_init_packet(pkt);

libavcodec/avpacket.c:58:5: 
  56.         size=0;
  57. 
  58.     av_init_packet(pkt);
          ^
  59.     pkt->data = data;
  60.     pkt->size = size;

libavcodec/avpacket.c:36:1: start of procedure av_init_packet()
    34. }
    35. 
    36. void av_init_packet(AVPacket *pkt)
        ^
    37. {
    38.     pkt->pts   = AV_NOPTS_VALUE;

libavcodec/avpacket.c:38:5: 
    36. void av_init_packet(AVPacket *pkt)
    37. {
    38.     pkt->pts   = AV_NOPTS_VALUE;
            ^
    39.     pkt->dts   = AV_NOPTS_VALUE;
    40.     pkt->pos   = -1;

libavcodec/avpacket.c:39:5: 
    37. {
    38.     pkt->pts   = AV_NOPTS_VALUE;
    39.     pkt->dts   = AV_NOPTS_VALUE;
            ^
    40.     pkt->pos   = -1;
    41.     pkt->duration = 0;

libavcodec/avpacket.c:40:5: 
    38.     pkt->pts   = AV_NOPTS_VALUE;
    39.     pkt->dts   = AV_NOPTS_VALUE;
    40.     pkt->pos   = -1;
            ^
    41.     pkt->duration = 0;
    42.     pkt->convergence_duration = 0;

libavcodec/avpacket.c:41:5: 
    39.     pkt->dts   = AV_NOPTS_VALUE;
    40.     pkt->pos   = -1;
    41.     pkt->duration = 0;
            ^
    42.     pkt->convergence_duration = 0;
    43.     pkt->flags = 0;

libavcodec/avpacket.c:42:5: 
    40.     pkt->pos   = -1;
    41.     pkt->duration = 0;
    42.     pkt->convergence_duration = 0;
            ^
    43.     pkt->flags = 0;
    44.     pkt->stream_index = 0;

libavcodec/avpacket.c:43:5: 
    41.     pkt->duration = 0;
    42.     pkt->convergence_duration = 0;
    43.     pkt->flags = 0;
            ^
    44.     pkt->stream_index = 0;
    45.     pkt->destruct= NULL;

libavcodec/avpacket.c:44:5: 
    42.     pkt->convergence_duration = 0;
    43.     pkt->flags = 0;
    44.     pkt->stream_index = 0;
            ^
    45.     pkt->destruct= NULL;
    46. }

libavcodec/avpacket.c:45:5: 
    43.     pkt->flags = 0;
    44.     pkt->stream_index = 0;
    45.     pkt->destruct= NULL;
            ^
    46. }
    47. 

libavcodec/avpacket.c:46:1: return from a call to av_init_packet
    44.     pkt->stream_index = 0;
    45.     pkt->destruct= NULL;
    46. }
        ^
    47. 
    48. int av_new_packet(AVPacket *pkt, int size)

libavcodec/avpacket.c:59:5: 
  57. 
  58.     av_init_packet(pkt);
  59.     pkt->data = data;
          ^
  60.     pkt->size = size;
  61.     pkt->destruct = av_destruct_packet;

libavcodec/avpacket.c:60:5: 
  58.     av_init_packet(pkt);
  59.     pkt->data = data;
  60.     pkt->size = size;
          ^
  61.     pkt->destruct = av_destruct_packet;
  62.     if(!data)

libavcodec/avpacket.c:61:5: 
  59.     pkt->data = data;
  60.     pkt->size = size;
  61.     pkt->destruct = av_destruct_packet;
          ^
  62.     if(!data)
  63.         return AVERROR(ENOMEM);

libavcodec/avpacket.c:62:9: Taking true branch
  60.     pkt->size = size;
  61.     pkt->destruct = av_destruct_packet;
  62.     if(!data)
              ^
  63.         return AVERROR(ENOMEM);
  64.     return 0;

libavcodec/avpacket.c:63:9: 
  61.     pkt->destruct = av_destruct_packet;
  62.     if(!data)
  63.         return AVERROR(ENOMEM);
              ^
  64.     return 0;
  65. }

libavcodec/avpacket.c:65:1: return from a call to av_new_packet
  63.         return AVERROR(ENOMEM);
  64.     return 0;
  65. }
      ^
  66. 
  67. void av_shrink_packet(AVPacket *pkt, int size)

libavformat/nutdec.c:751:5: 
749. 
750.     av_new_packet(pkt, size + nut->header_len[header_idx]);
751.     memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
         ^
752.     pkt->pos= url_ftell(bc); //FIXME
753.     get_buffer(bc, pkt->data + nut->header_len[header_idx], size);
