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

libavformat/rtpdec_h264.c:168:1: start of procedure h264_handle_packet()
166. 
167. // return 0 on packet, no more left, 1 on packet, 1 on partial packet...
168. static int h264_handle_packet(AVFormatContext *ctx,
     ^
169.                               PayloadContext *data,
170.                               AVStream *st,

libavformat/rtpdec_h264.c:176:5: 
174.                               int len, int flags)
175. {
176.     uint8_t nal = buf[0];
         ^
177.     uint8_t type = (nal & 0x1f);
178.     int result= 0;

libavformat/rtpdec_h264.c:177:5: 
175. {
176.     uint8_t nal = buf[0];
177.     uint8_t type = (nal & 0x1f);
         ^
178.     int result= 0;
179.     uint8_t start_sequence[]= {0, 0, 1};

libavformat/rtpdec_h264.c:178:5: 
176.     uint8_t nal = buf[0];
177.     uint8_t type = (nal & 0x1f);
178.     int result= 0;
         ^
179.     uint8_t start_sequence[]= {0, 0, 1};
180. 

libavformat/rtpdec_h264.c:179:5: 
177.     uint8_t type = (nal & 0x1f);
178.     int result= 0;
179.     uint8_t start_sequence[]= {0, 0, 1};
         ^
180. 
181. #ifdef DEBUG

libavformat/rtpdec_h264.c:185:5: 
183.     assert(data->cookie == MAGIC_COOKIE);
184. #endif
185.     assert(buf);
         ^
186. 
187.     if (type >= 1 && type <= 23)

libavformat/rtpdec_h264.c:187:9: Taking true branch
185.     assert(buf);
186. 
187.     if (type >= 1 && type <= 23)
             ^
188.         type = 1;              // simplify the case. (these are all the nal types used internally by the h264 codec)
189.     switch (type) {

libavformat/rtpdec_h264.c:187:22: Taking true branch
185.     assert(buf);
186. 
187.     if (type >= 1 && type <= 23)
                          ^
188.         type = 1;              // simplify the case. (these are all the nal types used internally by the h264 codec)
189.     switch (type) {

libavformat/rtpdec_h264.c:188:9: 
186. 
187.     if (type >= 1 && type <= 23)
188.         type = 1;              // simplify the case. (these are all the nal types used internally by the h264 codec)
             ^
189.     switch (type) {
190.     case 0:                    // undefined, but pass them through

libavformat/rtpdec_h264.c:189:5: 
187.     if (type >= 1 && type <= 23)
188.         type = 1;              // simplify the case. (these are all the nal types used internally by the h264 codec)
189.     switch (type) {
         ^
190.     case 0:                    // undefined, but pass them through
191.     case 1:

libavformat/rtpdec_h264.c:190:5: Switch condition is false. Skipping switch case
188.         type = 1;              // simplify the case. (these are all the nal types used internally by the h264 codec)
189.     switch (type) {
190.     case 0:                    // undefined, but pass them through
         ^
191.     case 1:
192.         av_new_packet(pkt, len+sizeof(start_sequence));

libavformat/rtpdec_h264.c:191:5: Switch condition is true. Entering switch case
189.     switch (type) {
190.     case 0:                    // undefined, but pass them through
191.     case 1:
         ^
192.         av_new_packet(pkt, len+sizeof(start_sequence));
193.         memcpy(pkt->data, start_sequence, sizeof(start_sequence));

libavformat/rtpdec_h264.c:192:9: 
190.     case 0:                    // undefined, but pass them through
191.     case 1:
192.         av_new_packet(pkt, len+sizeof(start_sequence));
             ^
193.         memcpy(pkt->data, start_sequence, sizeof(start_sequence));
194.         memcpy(pkt->data+sizeof(start_sequence), buf, len);

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

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

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

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

libavutil/mem.c:64:1: start of procedure av_malloc()
    62.    linker will do it automatically. */
    63. 
    64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
        ^
    65. {
    66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
    64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
    65. {
    66.     void *ptr = NULL;
            ^
    67. #if CONFIG_MEMALIGN_HACK
    68.     long diff;

libavutil/mem.c:72:8: Taking true branch
    70. 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-16) )
               ^
    73.         return NULL;
    74. 

libavutil/mem.c:73:9: 
    71.     /* let's disallow possible ambiguous cases */
    72.     if(size > (INT_MAX-16) )
    73.         return NULL;
                ^
    74. 
    75. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:117:1: return from a call to av_malloc
    115. #endif
    116.     return ptr;
    117. }
         ^
    118. 
    119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

libavformat/rtpdec_h264.c:193:9: 
191.     case 1:
192.         av_new_packet(pkt, len+sizeof(start_sequence));
193.         memcpy(pkt->data, start_sequence, sizeof(start_sequence));
             ^
194.         memcpy(pkt->data+sizeof(start_sequence), buf, len);
195. #ifdef DEBUG
