libavcodec/utils.c:1753: error: Null Dereference
  pointer `avctx->internal->buffer_pkt->side_data` last assigned on line 1752 could be null and is dereferenced by call to `av_packet_ref()` at line 1753, column 24.

libavcodec/utils.c:1708:1: start of procedure do_decode()
1706. }
1707. 
1708. static int do_decode(AVCodecContext *avctx, AVPacket *pkt)
      ^
1709. {
1710.     int got_frame;

libavcodec/utils.c:1713:5: Taking false branch
1711.     int ret;
1712. 
1713.     av_assert0(!avctx->internal->buffer_frame->buf[0]);
          ^
1714. 
1715.     if (!pkt)

libavcodec/utils.c:1713:5: Loop condition is false. Leaving loop
1711.     int ret;
1712. 
1713.     av_assert0(!avctx->internal->buffer_frame->buf[0]);
          ^
1714. 
1715.     if (!pkt)

libavcodec/utils.c:1715:10: Taking false branch
1713.     av_assert0(!avctx->internal->buffer_frame->buf[0]);
1714. 
1715.     if (!pkt)
               ^
1716.         pkt = avctx->internal->buffer_pkt;
1717. 

libavcodec/utils.c:1721:5: 
1719.     // of the legacy API, and users using the new API should not be forced to
1720.     // even know about this field.
1721.     avctx->refcounted_frames = 1;
          ^
1722. 
1723.     // Some codecs (at least wma lossless) will crash when feeding drain packets

libavcodec/utils.c:1725:9: Taking false branch
1723.     // Some codecs (at least wma lossless) will crash when feeding drain packets
1724.     // after EOF was signaled.
1725.     if (avctx->internal->draining_done)
              ^
1726.         return AVERROR_EOF;
1727. 

libavcodec/utils.c:1728:9: Taking false branch
1726.         return AVERROR_EOF;
1727. 
1728.     if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
              ^
1729.         ret = avcodec_decode_video2(avctx, avctx->internal->buffer_frame,
1730.                                     &got_frame, pkt);

libavcodec/utils.c:1733:16: Taking true branch
1731.         if (ret >= 0)
1732.             ret = pkt->size;
1733.     } else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
                     ^
1734.         ret = avcodec_decode_audio4(avctx, avctx->internal->buffer_frame,
1735.                                     &got_frame, pkt);

libavcodec/utils.c:1734:9: Skipping avcodec_decode_audio4(): empty list of specs
1732.             ret = pkt->size;
1733.     } else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
1734.         ret = avcodec_decode_audio4(avctx, avctx->internal->buffer_frame,
              ^
1735.                                     &got_frame, pkt);
1736.     } else {

libavcodec/utils.c:1740:9: Taking false branch
1738.     }
1739. 
1740.     if (ret < 0)
              ^
1741.         return ret;
1742. 

libavcodec/utils.c:1743:9: Taking true branch
1741.         return ret;
1742. 
1743.     if (avctx->internal->draining && !got_frame)
              ^
1744.         avctx->internal->draining_done = 1;
1745. 

libavcodec/utils.c:1743:39: Taking false branch
1741.         return ret;
1742. 
1743.     if (avctx->internal->draining && !got_frame)
                                            ^
1744.         avctx->internal->draining_done = 1;
1745. 

libavcodec/utils.c:1746:9: Taking false branch
1744.         avctx->internal->draining_done = 1;
1745. 
1746.     if (ret >= pkt->size) {
              ^
1747.         av_packet_unref(avctx->internal->buffer_pkt);
1748.     } else {

libavcodec/utils.c:1749:9: 
1747.         av_packet_unref(avctx->internal->buffer_pkt);
1748.     } else {
1749.         int consumed = ret;
              ^
1750. 
1751.         if (pkt != avctx->internal->buffer_pkt) {

libavcodec/utils.c:1751:13: Taking true branch
1749.         int consumed = ret;
1750. 
1751.         if (pkt != avctx->internal->buffer_pkt) {
                  ^
1752.             av_packet_unref(avctx->internal->buffer_pkt);
1753.             if ((ret = av_packet_ref(avctx->internal->buffer_pkt, pkt)) < 0)

libavcodec/utils.c:1752:13: 
1750. 
1751.         if (pkt != avctx->internal->buffer_pkt) {
1752.             av_packet_unref(avctx->internal->buffer_pkt);
                  ^
1753.             if ((ret = av_packet_ref(avctx->internal->buffer_pkt, pkt)) < 0)
1754.                 return ret;

libavcodec/avpacket.c:347:1: start of procedure av_packet_unref()
  345. }
  346. 
  347. void av_packet_unref(AVPacket *pkt)
       ^
  348. {
  349.     av_packet_free_side_data(pkt);

libavcodec/avpacket.c:349:5: 
  347. void av_packet_unref(AVPacket *pkt)
  348. {
  349.     av_packet_free_side_data(pkt);
           ^
  350.     av_buffer_unref(&pkt->buf);
  351.     av_init_packet(pkt);

libavcodec/avpacket.c:215:1: start of procedure av_packet_free_side_data()
    213. #endif
    214. 
    215. void av_packet_free_side_data(AVPacket *pkt)
         ^
    216. {
    217.     int i;

libavcodec/avpacket.c:218:10: 
    216. {
    217.     int i;
    218.     for (i = 0; i < pkt->side_data_elems; i++)
                  ^
    219.         av_free(pkt->side_data[i].data);
    220.     av_freep(&pkt->side_data);

libavcodec/avpacket.c:218:17: Loop condition is false. Leaving loop
    216. {
    217.     int i;
    218.     for (i = 0; i < pkt->side_data_elems; i++)
                         ^
    219.         av_free(pkt->side_data[i].data);
    220.     av_freep(&pkt->side_data);

libavcodec/avpacket.c:220:5: Skipping av_freep(): empty list of specs
    218.     for (i = 0; i < pkt->side_data_elems; i++)
    219.         av_free(pkt->side_data[i].data);
    220.     av_freep(&pkt->side_data);
             ^
    221.     pkt->side_data_elems = 0;
    222. }

libavcodec/avpacket.c:221:5: 
    219.         av_free(pkt->side_data[i].data);
    220.     av_freep(&pkt->side_data);
    221.     pkt->side_data_elems = 0;
             ^
    222. }
    223. 

libavcodec/avpacket.c:222:1: return from a call to av_packet_free_side_data
    220.     av_freep(&pkt->side_data);
    221.     pkt->side_data_elems = 0;
    222. }
         ^
    223. 
    224. #if FF_API_AVPACKET_OLD_API

libavcodec/avpacket.c:350:5: 
  348. {
  349.     av_packet_free_side_data(pkt);
  350.     av_buffer_unref(&pkt->buf);
           ^
  351.     av_init_packet(pkt);
  352.     pkt->data = NULL;

libavutil/buffer.c:107:1: start of procedure av_buffer_unref()
    105. }
    106. 
    107. void av_buffer_unref(AVBufferRef **buf)
         ^
    108. {
    109.     AVBuffer *b;

libavutil/buffer.c:111:10: Taking false branch
    109.     AVBuffer *b;
    110. 
    111.     if (!buf || !*buf)
                  ^
    112.         return;
    113.     b = (*buf)->buffer;

libavutil/buffer.c:111:18: Taking false branch
    109.     AVBuffer *b;
    110. 
    111.     if (!buf || !*buf)
                          ^
    112.         return;
    113.     b = (*buf)->buffer;

libavutil/buffer.c:113:5: 
    111.     if (!buf || !*buf)
    112.         return;
    113.     b = (*buf)->buffer;
             ^
    114.     av_freep(buf);
    115. 

libavutil/buffer.c:114:5: Skipping av_freep(): empty list of specs
    112.         return;
    113.     b = (*buf)->buffer;
    114.     av_freep(buf);
             ^
    115. 
    116.     if (atomic_fetch_add_explicit(&b->refcount, -1, memory_order_acq_rel) == 1) {

libavutil/buffer.c:116:9: Taking false branch
    114.     av_freep(buf);
    115. 
    116.     if (atomic_fetch_add_explicit(&b->refcount, -1, memory_order_acq_rel) == 1) {
                 ^
    117.         b->free(b->opaque, b->data);
    118.         av_freep(&b);

libavutil/buffer.c:116:5: 
    114.     av_freep(buf);
    115. 
    116.     if (atomic_fetch_add_explicit(&b->refcount, -1, memory_order_acq_rel) == 1) {
             ^
    117.         b->free(b->opaque, b->data);
    118.         av_freep(&b);

libavutil/buffer.c:120:1: return from a call to av_buffer_unref
    118.         av_freep(&b);
    119.     }
    120. }
         ^
    121. 
    122. int av_buffer_is_writable(const AVBufferRef *buf)

libavcodec/avpacket.c:351:5: 
  349.     av_packet_free_side_data(pkt);
  350.     av_buffer_unref(&pkt->buf);
  351.     av_init_packet(pkt);
           ^
  352.     pkt->data = NULL;
  353.     pkt->size = 0;

libavcodec/avpacket.c:31:1: start of procedure av_init_packet()
    29. #include "avcodec.h"
    30. 
    31. void av_init_packet(AVPacket *pkt)
        ^
    32. {
    33.     pkt->pts                  = AV_NOPTS_VALUE;

libavcodec/avpacket.c:33:5: 
    31. void av_init_packet(AVPacket *pkt)
    32. {
    33.     pkt->pts                  = AV_NOPTS_VALUE;
            ^
    34.     pkt->dts                  = AV_NOPTS_VALUE;
    35.     pkt->pos                  = -1;

libavcodec/avpacket.c:34:5: 
    32. {
    33.     pkt->pts                  = AV_NOPTS_VALUE;
    34.     pkt->dts                  = AV_NOPTS_VALUE;
            ^
    35.     pkt->pos                  = -1;
    36.     pkt->duration             = 0;

libavcodec/avpacket.c:35:5: 
    33.     pkt->pts                  = AV_NOPTS_VALUE;
    34.     pkt->dts                  = AV_NOPTS_VALUE;
    35.     pkt->pos                  = -1;
            ^
    36.     pkt->duration             = 0;
    37. #if FF_API_CONVERGENCE_DURATION

libavcodec/avpacket.c:36:5: 
    34.     pkt->dts                  = AV_NOPTS_VALUE;
    35.     pkt->pos                  = -1;
    36.     pkt->duration             = 0;
            ^
    37. #if FF_API_CONVERGENCE_DURATION
    38. FF_DISABLE_DEPRECATION_WARNINGS

libavcodec/avpacket.c:39:5: 
    37. #if FF_API_CONVERGENCE_DURATION
    38. FF_DISABLE_DEPRECATION_WARNINGS
    39.     pkt->convergence_duration = 0;
            ^
    40. FF_ENABLE_DEPRECATION_WARNINGS
    41. #endif

libavcodec/avpacket.c:42:5: 
    40. FF_ENABLE_DEPRECATION_WARNINGS
    41. #endif
    42.     pkt->flags                = 0;
            ^
    43.     pkt->stream_index         = 0;
    44.     pkt->buf                  = NULL;

libavcodec/avpacket.c:43:5: 
    41. #endif
    42.     pkt->flags                = 0;
    43.     pkt->stream_index         = 0;
            ^
    44.     pkt->buf                  = NULL;
    45.     pkt->side_data            = NULL;

libavcodec/avpacket.c:44:5: 
    42.     pkt->flags                = 0;
    43.     pkt->stream_index         = 0;
    44.     pkt->buf                  = NULL;
            ^
    45.     pkt->side_data            = NULL;
    46.     pkt->side_data_elems      = 0;

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

libavcodec/avpacket.c:46:5: 
    44.     pkt->buf                  = NULL;
    45.     pkt->side_data            = NULL;
    46.     pkt->side_data_elems      = 0;
            ^
    47. }
    48. 

libavcodec/avpacket.c:47:1: return from a call to av_init_packet
    45.     pkt->side_data            = NULL;
    46.     pkt->side_data_elems      = 0;
    47. }
        ^
    48. 
    49. AVPacket *av_packet_alloc(void)

libavcodec/avpacket.c:352:5: 
  350.     av_buffer_unref(&pkt->buf);
  351.     av_init_packet(pkt);
  352.     pkt->data = NULL;
           ^
  353.     pkt->size = 0;
  354. }

libavcodec/avpacket.c:353:5: 
  351.     av_init_packet(pkt);
  352.     pkt->data = NULL;
  353.     pkt->size = 0;
           ^
  354. }
  355. 

libavcodec/avpacket.c:354:1: return from a call to av_packet_unref
  352.     pkt->data = NULL;
  353.     pkt->size = 0;
  354. }
       ^
  355. 
  356. int av_packet_ref(AVPacket *dst, const AVPacket *src)

libavcodec/utils.c:1753:17: 
1751.         if (pkt != avctx->internal->buffer_pkt) {
1752.             av_packet_unref(avctx->internal->buffer_pkt);
1753.             if ((ret = av_packet_ref(avctx->internal->buffer_pkt, pkt)) < 0)
                      ^
1754.                 return ret;
1755.         }

libavcodec/avpacket.c:356:1: start of procedure av_packet_ref()
  354. }
  355. 
  356. int av_packet_ref(AVPacket *dst, const AVPacket *src)
       ^
  357. {
  358.     int ret;

libavcodec/avpacket.c:360:5: 
  358.     int ret;
  359. 
  360.     ret = av_packet_copy_props(dst, src);
           ^
  361.     if (ret < 0)
  362.         return ret;

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

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

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

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

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

libavcodec/avpacket.c:325:5: 
    323. #if FF_API_CONVERGENCE_DURATION
    324. FF_DISABLE_DEPRECATION_WARNINGS
    325.     dst->convergence_duration = src->convergence_duration;
             ^
    326. FF_ENABLE_DEPRECATION_WARNINGS
    327. #endif

libavcodec/avpacket.c:328:5: 
    326. FF_ENABLE_DEPRECATION_WARNINGS
    327. #endif
    328.     dst->flags                = src->flags;
             ^
    329.     dst->stream_index         = src->stream_index;
    330. 

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

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

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

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

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

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

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

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

libavcodec/avpacket.c:269:10: Taking false branch
      267.     uint8_t *data;
      268. 
      269.     if (!size || (unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
                    ^
      270.         return NULL;
      271.     data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);

libavcodec/avpacket.c:269:18: Taking false branch
      267.     uint8_t *data;
      268. 
      269.     if (!size || (unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
                            ^
      270.         return NULL;
      271.     data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);

libavcodec/avpacket.c:271:5: 
      269.     if (!size || (unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
      270.         return NULL;
      271.     data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
               ^
      272.     if (!data)
      273.         return NULL;

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

libavutil/mem.c:64:5: 
        62. void *av_malloc(size_t size)
        63. {
        64.     void *ptr = NULL;
                ^
        65. 
        66.     /* let's disallow possibly ambiguous cases */

libavutil/mem.c:67:9: Taking true branch
        65. 
        66.     /* let's disallow possibly ambiguous cases */
        67.     if (size > (INT_MAX - 32) || !size)
                    ^
        68.         return NULL;
        69. 

libavutil/mem.c:68:9: 
        66.     /* let's disallow possibly ambiguous cases */
        67.     if (size > (INT_MAX - 32) || !size)
        68.         return NULL;
                    ^
        69. 
        70. #if HAVE_POSIX_MEMALIGN

libavutil/mem.c:105:1: return from a call to av_malloc
        103. #endif
        104.     return ptr;
        105. }
             ^
        106. 
        107. void *av_realloc(void *ptr, size_t size)

libavcodec/avpacket.c:272:10: Taking true branch
      270.         return NULL;
      271.     data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
      272.     if (!data)
                    ^
      273.         return NULL;
      274. 

libavcodec/avpacket.c:273:9: 
      271.     data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
      272.     if (!data)
      273.         return NULL;
                   ^
      274. 
      275.     ret = av_packet_add_side_data(pkt, type, data, size);

libavcodec/avpacket.c:282:1: return from a call to av_packet_new_side_data
      280. 
      281.     return data;
      282. }
           ^
      283. 
      284. uint8_t *av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,

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

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

libavcodec/avpacket.c:215:1: start of procedure av_packet_free_side_data()
      213. #endif
      214. 
      215. void av_packet_free_side_data(AVPacket *pkt)
           ^
      216. {
      217.     int i;

libavcodec/avpacket.c:218:10: 
      216. {
      217.     int i;
      218.     for (i = 0; i < pkt->side_data_elems; i++)
                    ^
      219.         av_free(pkt->side_data[i].data);
      220.     av_freep(&pkt->side_data);

libavcodec/avpacket.c:218:17: Loop condition is false. Leaving loop
      216. {
      217.     int i;
      218.     for (i = 0; i < pkt->side_data_elems; i++)
                           ^
      219.         av_free(pkt->side_data[i].data);
      220.     av_freep(&pkt->side_data);

libavcodec/avpacket.c:220:5: Skipping av_freep(): empty list of specs
      218.     for (i = 0; i < pkt->side_data_elems; i++)
      219.         av_free(pkt->side_data[i].data);
      220.     av_freep(&pkt->side_data);
               ^
      221.     pkt->side_data_elems = 0;
      222. }

libavcodec/avpacket.c:221:5: 
      219.         av_free(pkt->side_data[i].data);
      220.     av_freep(&pkt->side_data);
      221.     pkt->side_data_elems = 0;
               ^
      222. }
      223. 

libavcodec/avpacket.c:222:1: return from a call to av_packet_free_side_data
      220.     av_freep(&pkt->side_data);
      221.     pkt->side_data_elems = 0;
      222. }
           ^
      223. 
      224. #if FF_API_AVPACKET_OLD_API

libavcodec/avpacket.c:339:13: 
    337.         if (!dst_data) {
    338.             av_packet_free_side_data(dst);
    339.             return AVERROR(ENOMEM);
                     ^
    340.         }
    341.         memcpy(dst_data, src_data, size);

libavcodec/avpacket.c:345:1: return from a call to av_packet_copy_props
    343. 
    344.     return 0;
    345. }
         ^
    346. 
    347. void av_packet_unref(AVPacket *pkt)

libavcodec/avpacket.c:361:9: Taking true branch
  359. 
  360.     ret = av_packet_copy_props(dst, src);
  361.     if (ret < 0)
               ^
  362.         return ret;
  363. 

libavcodec/avpacket.c:362:9: 
  360.     ret = av_packet_copy_props(dst, src);
  361.     if (ret < 0)
  362.         return ret;
               ^
  363. 
  364.     if (!src->buf) {

libavcodec/avpacket.c:386:1: return from a call to av_packet_ref
  384.     av_packet_free_side_data(dst);
  385.     return ret;
  386. }
       ^
  387. 
  388. AVPacket *av_packet_clone(const AVPacket *src)
