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

libavformat/rmdec.c:826:1: start of procedure ff_rm_retrieve_cache()
824. }
825. 
826. int
     ^
827. ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
828.                       AVStream *st, RMStream *ast, AVPacket *pkt)

libavformat/rmdec.c:830:5: 
828.                       AVStream *st, RMStream *ast, AVPacket *pkt)
829. {
830.     RMDemuxContext *rm = s->priv_data;
         ^
831. 
832.     assert (rm->audio_pkt_cnt > 0);

libavformat/rmdec.c:832:5: 
830.     RMDemuxContext *rm = s->priv_data;
831. 
832.     assert (rm->audio_pkt_cnt > 0);
         ^
833. 
834.     if (ast->deint_id == DEINT_ID_VBRF ||

libavformat/rmdec.c:834:9: Taking false branch
832.     assert (rm->audio_pkt_cnt > 0);
833. 
834.     if (ast->deint_id == DEINT_ID_VBRF ||
             ^
835.         ast->deint_id == DEINT_ID_VBRS)
836.         av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);

libavformat/rmdec.c:835:9: Taking false branch
833. 
834.     if (ast->deint_id == DEINT_ID_VBRF ||
835.         ast->deint_id == DEINT_ID_VBRS)
             ^
836.         av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
837.     else {

libavformat/rmdec.c:838:9: 
836.         av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]);
837.     else {
838.         av_new_packet(pkt, st->codec->block_align);
             ^
839.         memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this
840.                (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),

libavcodec/avpacket.c:60:1: start of procedure av_new_packet()
  58. }
  59. 
  60. int av_new_packet(AVPacket *pkt, int size)
      ^
  61. {
  62.     uint8_t *data= NULL;

libavcodec/avpacket.c:62:5: 
  60. int av_new_packet(AVPacket *pkt, int size)
  61. {
  62.     uint8_t *data= NULL;
          ^
  63.     if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
  64.         data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);

libavcodec/avpacket.c:63:8: Taking true branch
  61. {
  62.     uint8_t *data= NULL;
  63.     if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
             ^
  64.         data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
  65.     if (data){

libavcodec/avpacket.c:64:9: 
  62.     uint8_t *data= NULL;
  63.     if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
  64.         data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
              ^
  65.     if (data){
  66.         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(size_t size)
        ^
    65. {
    66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
    64. void *av_malloc(size_t 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-32) )
               ^
    73.         return NULL;
    74. 

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

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

libavcodec/avpacket.c:65:9: Taking false branch
  63.     if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE)
  64.         data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
  65.     if (data){
              ^
  66.         memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
  67.     }else

libavcodec/avpacket.c:68:9: 
  66.         memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
  67.     }else
  68.         size=0;
              ^
  69. 
  70.     av_init_packet(pkt);

libavcodec/avpacket.c:70:5: 
  68.         size=0;
  69. 
  70.     av_init_packet(pkt);
          ^
  71.     pkt->data = data;
  72.     pkt->size = size;

libavcodec/avpacket.c:46:1: start of procedure av_init_packet()
    44. }
    45. 
    46. void av_init_packet(AVPacket *pkt)
        ^
    47. {
    48.     pkt->pts   = AV_NOPTS_VALUE;

libavcodec/avpacket.c:48:5: 
    46. void av_init_packet(AVPacket *pkt)
    47. {
    48.     pkt->pts   = AV_NOPTS_VALUE;
            ^
    49.     pkt->dts   = AV_NOPTS_VALUE;
    50.     pkt->pos   = -1;

libavcodec/avpacket.c:49:5: 
    47. {
    48.     pkt->pts   = AV_NOPTS_VALUE;
    49.     pkt->dts   = AV_NOPTS_VALUE;
            ^
    50.     pkt->pos   = -1;
    51.     pkt->duration = 0;

libavcodec/avpacket.c:50:5: 
    48.     pkt->pts   = AV_NOPTS_VALUE;
    49.     pkt->dts   = AV_NOPTS_VALUE;
    50.     pkt->pos   = -1;
            ^
    51.     pkt->duration = 0;
    52.     pkt->convergence_duration = 0;

libavcodec/avpacket.c:51:5: 
    49.     pkt->dts   = AV_NOPTS_VALUE;
    50.     pkt->pos   = -1;
    51.     pkt->duration = 0;
            ^
    52.     pkt->convergence_duration = 0;
    53.     pkt->flags = 0;

libavcodec/avpacket.c:52:5: 
    50.     pkt->pos   = -1;
    51.     pkt->duration = 0;
    52.     pkt->convergence_duration = 0;
            ^
    53.     pkt->flags = 0;
    54.     pkt->stream_index = 0;

libavcodec/avpacket.c:53:5: 
    51.     pkt->duration = 0;
    52.     pkt->convergence_duration = 0;
    53.     pkt->flags = 0;
            ^
    54.     pkt->stream_index = 0;
    55.     pkt->destruct= NULL;

libavcodec/avpacket.c:54:5: 
    52.     pkt->convergence_duration = 0;
    53.     pkt->flags = 0;
    54.     pkt->stream_index = 0;
            ^
    55.     pkt->destruct= NULL;
    56.     pkt->side_data       = NULL;

libavcodec/avpacket.c:55:5: 
    53.     pkt->flags = 0;
    54.     pkt->stream_index = 0;
    55.     pkt->destruct= NULL;
            ^
    56.     pkt->side_data       = NULL;
    57.     pkt->side_data_elems = 0;

libavcodec/avpacket.c:56:5: 
    54.     pkt->stream_index = 0;
    55.     pkt->destruct= NULL;
    56.     pkt->side_data       = NULL;
            ^
    57.     pkt->side_data_elems = 0;
    58. }

libavcodec/avpacket.c:57:5: 
    55.     pkt->destruct= NULL;
    56.     pkt->side_data       = NULL;
    57.     pkt->side_data_elems = 0;
            ^
    58. }
    59. 

libavcodec/avpacket.c:58:1: return from a call to av_init_packet
    56.     pkt->side_data       = NULL;
    57.     pkt->side_data_elems = 0;
    58. }
        ^
    59. 
    60. int av_new_packet(AVPacket *pkt, int size)

libavcodec/avpacket.c:71:5: 
  69. 
  70.     av_init_packet(pkt);
  71.     pkt->data = data;
          ^
  72.     pkt->size = size;
  73.     pkt->destruct = av_destruct_packet;

libavcodec/avpacket.c:72:5: 
  70.     av_init_packet(pkt);
  71.     pkt->data = data;
  72.     pkt->size = size;
          ^
  73.     pkt->destruct = av_destruct_packet;
  74.     if(!data)

libavcodec/avpacket.c:73:5: 
  71.     pkt->data = data;
  72.     pkt->size = size;
  73.     pkt->destruct = av_destruct_packet;
          ^
  74.     if(!data)
  75.         return AVERROR(ENOMEM);

libavcodec/avpacket.c:74:9: Taking true branch
  72.     pkt->size = size;
  73.     pkt->destruct = av_destruct_packet;
  74.     if(!data)
              ^
  75.         return AVERROR(ENOMEM);
  76.     return 0;

libavcodec/avpacket.c:75:9: 
  73.     pkt->destruct = av_destruct_packet;
  74.     if(!data)
  75.         return AVERROR(ENOMEM);
              ^
  76.     return 0;
  77. }

libavcodec/avpacket.c:77:1: return from a call to av_new_packet
  75.         return AVERROR(ENOMEM);
  76.     return 0;
  77. }
      ^
  78. 
  79. void av_shrink_packet(AVPacket *pkt, int size)

libavformat/rmdec.c:839:9: 
837.     else {
838.         av_new_packet(pkt, st->codec->block_align);
839.         memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this
             ^
840.                (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt),
841.                st->codec->block_align);
