libavcodec/avpacket.c:337: error: Null Dereference
  pointer `dst->side_data` last assigned on line 334 could be null and is dereferenced by call to `av_packet_free_side_data()` at line 337, column 13.

libavcodec/avpacket.c:317:1: start of procedure av_packet_copy_props()
315. }
316. 
317. int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
     ^
318. {
319.     int i;

libavcodec/avpacket.c:321:5: 
319.     int i;
320. 
321.     dst->pts                  = src->pts;
         ^
322.     dst->dts                  = src->dts;
323.     dst->pos                  = src->pos;

libavcodec/avpacket.c:322:5: 
320. 
321.     dst->pts                  = src->pts;
322.     dst->dts                  = src->dts;
         ^
323.     dst->pos                  = src->pos;
324.     dst->duration             = src->duration;

libavcodec/avpacket.c:323:5: 
321.     dst->pts                  = src->pts;
322.     dst->dts                  = src->dts;
323.     dst->pos                  = src->pos;
         ^
324.     dst->duration             = src->duration;
325.     dst->convergence_duration = src->convergence_duration;

libavcodec/avpacket.c:324:5: 
322.     dst->dts                  = src->dts;
323.     dst->pos                  = src->pos;
324.     dst->duration             = src->duration;
         ^
325.     dst->convergence_duration = src->convergence_duration;
326.     dst->flags                = src->flags;

libavcodec/avpacket.c:325:5: 
323.     dst->pos                  = src->pos;
324.     dst->duration             = src->duration;
325.     dst->convergence_duration = src->convergence_duration;
         ^
326.     dst->flags                = src->flags;
327.     dst->stream_index         = src->stream_index;

libavcodec/avpacket.c:326:5: 
324.     dst->duration             = src->duration;
325.     dst->convergence_duration = src->convergence_duration;
326.     dst->flags                = src->flags;
         ^
327.     dst->stream_index         = src->stream_index;
328.     dst->side_data_elems      = src->side_data_elems;

libavcodec/avpacket.c:327:5: 
325.     dst->convergence_duration = src->convergence_duration;
326.     dst->flags                = src->flags;
327.     dst->stream_index         = src->stream_index;
         ^
328.     dst->side_data_elems      = src->side_data_elems;
329. 

libavcodec/avpacket.c:328:5: 
326.     dst->flags                = src->flags;
327.     dst->stream_index         = src->stream_index;
328.     dst->side_data_elems      = src->side_data_elems;
         ^
329. 
330.     for (i = 0; i < src->side_data_elems; i++) {

libavcodec/avpacket.c:330:10: 
328.     dst->side_data_elems      = src->side_data_elems;
329. 
330.     for (i = 0; i < src->side_data_elems; i++) {
              ^
331.          enum AVPacketSideDataType type = src->side_data[i].type;
332.          int size          = src->side_data[i].size;

libavcodec/avpacket.c:330:17: Loop condition is true. Entering loop body
328.     dst->side_data_elems      = src->side_data_elems;
329. 
330.     for (i = 0; i < src->side_data_elems; i++) {
                     ^
331.          enum AVPacketSideDataType type = src->side_data[i].type;
332.          int size          = src->side_data[i].size;

libavcodec/avpacket.c:331:10: 
329. 
330.     for (i = 0; i < src->side_data_elems; i++) {
331.          enum AVPacketSideDataType type = src->side_data[i].type;
              ^
332.          int size          = src->side_data[i].size;
333.          uint8_t *src_data = src->side_data[i].data;

libavcodec/avpacket.c:332:10: 
330.     for (i = 0; i < src->side_data_elems; i++) {
331.          enum AVPacketSideDataType type = src->side_data[i].type;
332.          int size          = src->side_data[i].size;
              ^
333.          uint8_t *src_data = src->side_data[i].data;
334.          uint8_t *dst_data = av_packet_new_side_data(dst, type, size);

libavcodec/avpacket.c:333:10: 
331.          enum AVPacketSideDataType type = src->side_data[i].type;
332.          int size          = src->side_data[i].size;
333.          uint8_t *src_data = src->side_data[i].data;
              ^
334.          uint8_t *dst_data = av_packet_new_side_data(dst, type, size);
335. 

libavcodec/avpacket.c:334:10: 
332.          int size          = src->side_data[i].size;
333.          uint8_t *src_data = src->side_data[i].data;
334.          uint8_t *dst_data = av_packet_new_side_data(dst, type, size);
              ^
335. 
336.         if (!dst_data) {

libavcodec/avpacket.c:261:1: start of procedure av_packet_new_side_data()
  259. }
  260. 
  261. uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
       ^
  262.                                  int size)
  263. {

libavcodec/avpacket.c:264:5: 
  262.                                  int size)
  263. {
  264.     int elems = pkt->side_data_elems;
           ^
  265. 
  266.     if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))

libavcodec/avpacket.c:266:9: Taking false branch
  264.     int elems = pkt->side_data_elems;
  265. 
  266.     if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))
               ^
  267.         return NULL;
  268.     if ((unsigned)size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)

libavcodec/avpacket.c:268:9: Taking false branch
  266.     if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))
  267.         return NULL;
  268.     if ((unsigned)size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
               ^
  269.         return NULL;
  270. 

libavcodec/avpacket.c:271:5: 
  269.         return NULL;
  270. 
  271.     pkt->side_data = av_realloc(pkt->side_data,
           ^
  272.                                 (elems + 1) * sizeof(*pkt->side_data));
  273.     if (!pkt->side_data)

libavutil/mem.c:116:1: start of procedure av_realloc()
    114. }
    115. 
    116. void *av_realloc(void *ptr, size_t size)
         ^
    117. {
    118. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:123:9: Taking true branch
    121. 
    122.     /* let's disallow possibly ambiguous cases */
    123.     if (size > (INT_MAX - 16))
                 ^
    124.         return NULL;
    125. 

libavutil/mem.c:124:9: 
    122.     /* let's disallow possibly ambiguous cases */
    123.     if (size > (INT_MAX - 16))
    124.         return NULL;
                 ^
    125. 
    126. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:137:1: return from a call to av_realloc
    135.     return realloc(ptr, size);
    136. #endif
    137. }
         ^
    138. 
    139. int av_reallocp(void *ptr, size_t size)

libavcodec/avpacket.c:273:10: Taking true branch
  271.     pkt->side_data = av_realloc(pkt->side_data,
  272.                                 (elems + 1) * sizeof(*pkt->side_data));
  273.     if (!pkt->side_data)
                ^
  274.         return NULL;
  275. 

libavcodec/avpacket.c:274:9: 
  272.                                 (elems + 1) * sizeof(*pkt->side_data));
  273.     if (!pkt->side_data)
  274.         return NULL;
               ^
  275. 
  276.     pkt->side_data[elems].data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);

libavcodec/avpacket.c:284:1: return from a call to av_packet_new_side_data
  282. 
  283.     return pkt->side_data[elems].data;
  284. }
       ^
  285. 
  286. uint8_t *av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,

libavcodec/avpacket.c:336:14: Taking true branch
334.          uint8_t *dst_data = av_packet_new_side_data(dst, type, size);
335. 
336.         if (!dst_data) {
                  ^
337.             av_packet_free_side_data(dst);
338.             return AVERROR(ENOMEM);

libavcodec/avpacket.c:337:13: 
335. 
336.         if (!dst_data) {
337.             av_packet_free_side_data(dst);
                 ^
338.             return AVERROR(ENOMEM);
339.         }

libavcodec/avpacket.c:233:1: start of procedure av_packet_free_side_data()
  231. }
  232. 
  233. void av_packet_free_side_data(AVPacket *pkt)
       ^
  234. {
  235.     int i;

libavcodec/avpacket.c:236:10: 
  234. {
  235.     int i;
  236.     for (i = 0; i < pkt->side_data_elems; i++)
                ^
  237.         av_free(pkt->side_data[i].data);
  238.     av_freep(&pkt->side_data);

libavcodec/avpacket.c:236:17: Loop condition is true. Entering loop body
  234. {
  235.     int i;
  236.     for (i = 0; i < pkt->side_data_elems; i++)
                       ^
  237.         av_free(pkt->side_data[i].data);
  238.     av_freep(&pkt->side_data);

libavcodec/avpacket.c:237:9: 
  235.     int i;
  236.     for (i = 0; i < pkt->side_data_elems; i++)
  237.         av_free(pkt->side_data[i].data);
               ^
  238.     av_freep(&pkt->side_data);
  239.     pkt->side_data_elems = 0;
