libavcodec/decode.c:458: error: Null Dereference
  pointer `avci->buffer_pkt->side_data` last assigned on line 456 could be null and is dereferenced by call to `av_packet_ref()` at line 458, column 15.

libavcodec/decode.c:445:1: start of procedure avcodec_send_packet()
443. }
444. 
445. int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
     ^
446. {
447.     AVCodecInternal *avci = avctx->internal;

libavcodec/decode.c:447:5: 
445. int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
446. {
447.     AVCodecInternal *avci = avctx->internal;
         ^
448.     int ret = 0;
449. 

libavcodec/decode.c:448:5: 
446. {
447.     AVCodecInternal *avci = avctx->internal;
448.     int ret = 0;
         ^
449. 
450.     if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))

libavcodec/decode.c:450:10: 
448.     int ret = 0;
449. 
450.     if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
              ^
451.         return AVERROR(EINVAL);
452. 

libavcodec/utils.c:1473:1: start of procedure avcodec_is_open()
  1471. #endif
  1472. 
  1473. int avcodec_is_open(AVCodecContext *s)
        ^
  1474. {
  1475.     return !!s->internal;

libavcodec/utils.c:1475:14: Condition is false
  1473. int avcodec_is_open(AVCodecContext *s)
  1474. {
  1475.     return !!s->internal;
                     ^
  1476. }
  1477. 

libavcodec/utils.c:1475:12: 
  1473. int avcodec_is_open(AVCodecContext *s)
  1474. {
  1475.     return !!s->internal;
                   ^
  1476. }
  1477. 

libavcodec/utils.c:1475:5: 
  1473. int avcodec_is_open(AVCodecContext *s)
  1474. {
  1475.     return !!s->internal;
            ^
  1476. }
  1477. 

libavcodec/utils.c:1476:1: return from a call to avcodec_is_open
  1474. {
  1475.     return !!s->internal;
  1476. }
        ^
  1477. 
  1478. const uint8_t *avpriv_find_start_code(const uint8_t *restrict p,

libavcodec/decode.c:450:10: Taking false branch
448.     int ret = 0;
449. 
450.     if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
              ^
451.         return AVERROR(EINVAL);
452. 

libavcodec/decode.c:450:37: 
448.     int ret = 0;
449. 
450.     if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
                                         ^
451.         return AVERROR(EINVAL);
452. 

libavcodec/utils.c:103:1: start of procedure av_codec_is_decoder()
  101. }
  102. 
  103. int av_codec_is_decoder(const AVCodec *codec)
       ^
  104. {
  105.     return codec && (codec->decode || codec->receive_frame);

libavcodec/utils.c:105:12: Condition is true
  103. int av_codec_is_decoder(const AVCodec *codec)
  104. {
  105.     return codec && (codec->decode || codec->receive_frame);
                  ^
  106. }
  107. 

libavcodec/utils.c:105:22: Condition is true
  103. int av_codec_is_decoder(const AVCodec *codec)
  104. {
  105.     return codec && (codec->decode || codec->receive_frame);
                            ^
  106. }
  107. 

libavcodec/utils.c:105:12: 
  103. int av_codec_is_decoder(const AVCodec *codec)
  104. {
  105.     return codec && (codec->decode || codec->receive_frame);
                  ^
  106. }
  107. 

libavcodec/utils.c:105:5: 
  103. int av_codec_is_decoder(const AVCodec *codec)
  104. {
  105.     return codec && (codec->decode || codec->receive_frame);
           ^
  106. }
  107. 

libavcodec/utils.c:106:1: return from a call to av_codec_is_decoder
  104. {
  105.     return codec && (codec->decode || codec->receive_frame);
  106. }
       ^
  107. 
  108. av_cold void avcodec_register(AVCodec *codec)

libavcodec/decode.c:450:37: Taking false branch
448.     int ret = 0;
449. 
450.     if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
                                         ^
451.         return AVERROR(EINVAL);
452. 

libavcodec/decode.c:453:9: Taking false branch
451.         return AVERROR(EINVAL);
452. 
453.     if (avctx->internal->draining)
             ^
454.         return AVERROR_EOF;
455. 

libavcodec/decode.c:456:5: 
454.         return AVERROR_EOF;
455. 
456.     av_packet_unref(avci->buffer_pkt);
         ^
457.     if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
458.         ret = av_packet_ref(avci->buffer_pkt, avpkt);

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

libavcodec/avpacket.c:350:5: 
  348. void av_packet_unref(AVPacket *pkt)
  349. {
  350.     av_packet_free_side_data(pkt);
           ^
  351.     av_buffer_unref(&pkt->buf);
  352.     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:351:5: 
  349. {
  350.     av_packet_free_side_data(pkt);
  351.     av_buffer_unref(&pkt->buf);
           ^
  352.     av_init_packet(pkt);
  353.     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:352:5: 
  350.     av_packet_free_side_data(pkt);
  351.     av_buffer_unref(&pkt->buf);
  352.     av_init_packet(pkt);
           ^
  353.     pkt->data = NULL;
  354.     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:353:5: 
  351.     av_buffer_unref(&pkt->buf);
  352.     av_init_packet(pkt);
  353.     pkt->data = NULL;
           ^
  354.     pkt->size = 0;
  355. }

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

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

libavcodec/decode.c:457:9: Taking true branch
455. 
456.     av_packet_unref(avci->buffer_pkt);
457.     if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
             ^
458.         ret = av_packet_ref(avci->buffer_pkt, avpkt);
459.         if (ret < 0)

libavcodec/decode.c:457:19: Taking false branch
455. 
456.     av_packet_unref(avci->buffer_pkt);
457.     if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
                       ^
458.         ret = av_packet_ref(avci->buffer_pkt, avpkt);
459.         if (ret < 0)

libavcodec/decode.c:457:34: Taking true branch
455. 
456.     av_packet_unref(avci->buffer_pkt);
457.     if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
                                      ^
458.         ret = av_packet_ref(avci->buffer_pkt, avpkt);
459.         if (ret < 0)

libavcodec/decode.c:458:9: 
456.     av_packet_unref(avci->buffer_pkt);
457.     if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
458.         ret = av_packet_ref(avci->buffer_pkt, avpkt);
             ^
459.         if (ret < 0)
460.             return ret;

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

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

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

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

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

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

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

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

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

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

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

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

libavcodec/avpacket.c:345:5: 
    343.     }
    344. 
    345.     return 0;
             ^
    346. }
    347. 

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

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

libavcodec/avpacket.c:365:10: Taking true branch
  363.         return ret;
  364. 
  365.     if (!src->buf) {
                ^
  366.         ret = packet_alloc(&dst->buf, src->size);
  367.         if (ret < 0)

libavcodec/avpacket.c:366:9: 
  364. 
  365.     if (!src->buf) {
  366.         ret = packet_alloc(&dst->buf, src->size);
               ^
  367.         if (ret < 0)
  368.             goto fail;

libavcodec/avpacket.c:69:1: start of procedure packet_alloc()
    67. }
    68. 
    69. static int packet_alloc(AVBufferRef **buf, int size)
        ^
    70. {
    71.     int ret;

libavcodec/avpacket.c:72:9: Taking false branch
    70. {
    71.     int ret;
    72.     if (size < 0 || size >= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
                ^
    73.         return AVERROR(EINVAL);
    74. 

libavcodec/avpacket.c:72:21: Taking false branch
    70. {
    71.     int ret;
    72.     if (size < 0 || size >= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
                            ^
    73.         return AVERROR(EINVAL);
    74. 

libavcodec/avpacket.c:75:5: 
    73.         return AVERROR(EINVAL);
    74. 
    75.     ret = av_buffer_realloc(buf, size + AV_INPUT_BUFFER_PADDING_SIZE);
            ^
    76.     if (ret < 0)
    77.         return ret;

libavutil/buffer.c:148:1: start of procedure av_buffer_realloc()
      146. }
      147. 
      148. int av_buffer_realloc(AVBufferRef **pbuf, int size)
           ^
      149. {
      150.     AVBufferRef *buf = *pbuf;

libavutil/buffer.c:150:5: 
      148. int av_buffer_realloc(AVBufferRef **pbuf, int size)
      149. {
      150.     AVBufferRef *buf = *pbuf;
               ^
      151.     uint8_t *tmp;
      152. 

libavutil/buffer.c:153:10: Taking false branch
      151.     uint8_t *tmp;
      152. 
      153.     if (!buf) {
                    ^
      154.         /* allocate a new buffer with av_realloc(), so it will be reallocatable
      155.          * later */

libavutil/buffer.c:170:16: Taking false branch
      168. 
      169.         return 0;
      170.     } else if (buf->size == size)
                          ^
      171.         return 0;
      172. 

libavutil/buffer.c:173:11: Taking false branch
      171.         return 0;
      172. 
      173.     if (!(buf->buffer->flags & BUFFER_FLAG_REALLOCATABLE) ||
                     ^
      174.         !av_buffer_is_writable(buf) || buf->data != buf->buffer->data) {
      175.         /* cannot realloc, allocate a new reallocable buffer and copy data */

libavutil/buffer.c:174:10: 
      172. 
      173.     if (!(buf->buffer->flags & BUFFER_FLAG_REALLOCATABLE) ||
      174.         !av_buffer_is_writable(buf) || buf->data != buf->buffer->data) {
                    ^
      175.         /* cannot realloc, allocate a new reallocable buffer and copy data */
      176.         AVBufferRef *new = NULL;

libavutil/buffer.c:122:1: start of procedure av_buffer_is_writable()
        120. }
        121. 
        122. int av_buffer_is_writable(const AVBufferRef *buf)
             ^
        123. {
        124.     if (buf->buffer->flags & AV_BUFFER_FLAG_READONLY)

libavutil/buffer.c:124:9: Taking false branch
        122. int av_buffer_is_writable(const AVBufferRef *buf)
        123. {
        124.     if (buf->buffer->flags & AV_BUFFER_FLAG_READONLY)
                     ^
        125.         return 0;
        126. 

libavutil/buffer.c:127:12: Condition is true
        125.         return 0;
        126. 
        127.     return atomic_load(&buf->buffer->refcount) == 1;
                        ^
        128. }
        129. 

libavutil/buffer.c:127:5: 
        125.         return 0;
        126. 
        127.     return atomic_load(&buf->buffer->refcount) == 1;
                 ^
        128. }
        129. 

libavutil/buffer.c:128:1: return from a call to av_buffer_is_writable
        126. 
        127.     return atomic_load(&buf->buffer->refcount) == 1;
        128. }
             ^
        129. 
        130. int av_buffer_make_writable(AVBufferRef **pbuf)

libavutil/buffer.c:174:10: Taking false branch
      172. 
      173.     if (!(buf->buffer->flags & BUFFER_FLAG_REALLOCATABLE) ||
      174.         !av_buffer_is_writable(buf) || buf->data != buf->buffer->data) {
                    ^
      175.         /* cannot realloc, allocate a new reallocable buffer and copy data */
      176.         AVBufferRef *new = NULL;

libavutil/buffer.c:174:40: Taking false branch
      172. 
      173.     if (!(buf->buffer->flags & BUFFER_FLAG_REALLOCATABLE) ||
      174.         !av_buffer_is_writable(buf) || buf->data != buf->buffer->data) {
                                                  ^
      175.         /* cannot realloc, allocate a new reallocable buffer and copy data */
      176.         AVBufferRef *new = NULL;

libavutil/buffer.c:189:5: 
      187.     }
      188. 
      189.     tmp = av_realloc(buf->buffer->data, size);
               ^
      190.     if (!tmp)
      191.         return AVERROR(ENOMEM);

libavutil/mem.c:107:1: start of procedure av_realloc()
        105. }
        106. 
        107. void *av_realloc(void *ptr, size_t size)
             ^
        108. {
        109.     /* let's disallow possibly ambiguous cases */

libavutil/mem.c:110:9: Taking false branch
        108. {
        109.     /* let's disallow possibly ambiguous cases */
        110.     if (size > (INT_MAX - 16))
                     ^
        111.         return NULL;
        112. 

libavutil/mem.c:116:5: 
        114.     return _aligned_realloc(ptr, size, 32);
        115. #else
        116.     return realloc(ptr, size);
                 ^
        117. #endif
        118. }

libavutil/mem.c:118:1: return from a call to av_realloc
        116.     return realloc(ptr, size);
        117. #endif
        118. }
             ^
        119. 
        120. int av_reallocp(void *ptr, size_t size)

libavutil/buffer.c:190:10: Taking false branch
      188. 
      189.     tmp = av_realloc(buf->buffer->data, size);
      190.     if (!tmp)
                    ^
      191.         return AVERROR(ENOMEM);
      192. 

libavutil/buffer.c:193:5: 
      191.         return AVERROR(ENOMEM);
      192. 
      193.     buf->buffer->data = buf->data = tmp;
               ^
      194.     buf->buffer->size = buf->size = size;
      195.     return 0;

libavutil/buffer.c:194:5: 
      192. 
      193.     buf->buffer->data = buf->data = tmp;
      194.     buf->buffer->size = buf->size = size;
               ^
      195.     return 0;
      196. }

libavutil/buffer.c:195:5: 
      193.     buf->buffer->data = buf->data = tmp;
      194.     buf->buffer->size = buf->size = size;
      195.     return 0;
               ^
      196. }
      197. 

libavutil/buffer.c:196:1: return from a call to av_buffer_realloc
      194.     buf->buffer->size = buf->size = size;
      195.     return 0;
      196. }
           ^
      197. 
      198. AVBufferPool *av_buffer_pool_init2(int size, void *opaque,

libavcodec/avpacket.c:76:9: Taking false branch
    74. 
    75.     ret = av_buffer_realloc(buf, size + AV_INPUT_BUFFER_PADDING_SIZE);
    76.     if (ret < 0)
                ^
    77.         return ret;
    78. 

libavcodec/avpacket.c:79:5: 
    77.         return ret;
    78. 
    79.     memset((*buf)->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
            ^
    80. 
    81.     return 0;

libavcodec/avpacket.c:81:5: 
    79.     memset((*buf)->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
    80. 
    81.     return 0;
            ^
    82. }
    83. 

libavcodec/avpacket.c:82:1: return from a call to packet_alloc
    80. 
    81.     return 0;
    82. }
        ^
    83. 
    84. int av_new_packet(AVPacket *pkt, int size)

libavcodec/avpacket.c:367:13: Taking false branch
  365.     if (!src->buf) {
  366.         ret = packet_alloc(&dst->buf, src->size);
  367.         if (ret < 0)
                   ^
  368.             goto fail;
  369.         memcpy(dst->buf->data, src->data, src->size);

libavcodec/avpacket.c:369:9: 
  367.         if (ret < 0)
  368.             goto fail;
  369.         memcpy(dst->buf->data, src->data, src->size);
               ^
  370. 
  371.         dst->data = dst->buf->data;

libavcodec/avpacket.c:371:9: 
  369.         memcpy(dst->buf->data, src->data, src->size);
  370. 
  371.         dst->data = dst->buf->data;
               ^
  372.     } else {
  373.         dst->buf = av_buffer_ref(src->buf);

libavcodec/avpacket.c:381:5: 
  379.     }
  380. 
  381.     dst->size = src->size;
           ^
  382. 
  383.     return 0;

libavcodec/avpacket.c:383:5: 
  381.     dst->size = src->size;
  382. 
  383.     return 0;
           ^
  384. fail:
  385.     av_packet_free_side_data(dst);

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

int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
{
    AVCodecInternal *avci = avctx->internal;
    int ret = 0;
    if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
        return AVERROR(EINVAL);
    if (avctx->internal->draining)
        return AVERROR_EOF;
    av_packet_unref(avci->buffer_pkt);
    if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
        ret = av_packet_ref(avci->buffer_pkt, avpkt);
        if (ret < 0)
            return ret;
    }
    ret = av_bsf_send_packet(avci->filter.bsfs[0], avci->buffer_pkt);
    if (ret < 0) {
        av_packet_unref(avci->buffer_pkt);
        return ret;
    }
    if (!avci->buffer_frame->buf[0]) {
        ret = decode_receive_frame_internal(avctx, avci->buffer_frame);
        if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
            return ret;
    }
    return 0;
}
['int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)\n{\n    AVCodecInternal *avci = avctx->internal;\n    int ret = 0;\n    if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))\n        return AVERROR(EINVAL);\n    if (avctx->internal->draining)\n        return AVERROR_EOF;\n    av_packet_unref(avci->buffer_pkt);\n    if (avpkt && (avpkt->data || avpkt->side_data_elems)) {\n        ret = av_packet_ref(avci->buffer_pkt, avpkt);\n        if (ret < 0)\n            return ret;\n    }\n    ret = av_bsf_send_packet(avci->filter.bsfs[0], avci->buffer_pkt);\n    if (ret < 0) {\n        av_packet_unref(avci->buffer_pkt);\n        return ret;\n    }\n    if (!avci->buffer_frame->buf[0]) {\n        ret = decode_receive_frame_internal(avctx, avci->buffer_frame);\n        if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)\n            return ret;\n    }\n    return 0;\n}', 'int avcodec_is_open(AVCodecContext *s)\n{\n    return !!s->internal;\n}', 'int av_codec_is_decoder(const AVCodec *codec)\n{\n    return codec && (codec->decode || codec->receive_frame);\n}', 'void av_packet_unref(AVPacket *pkt)\n{\n    av_packet_free_side_data(pkt);\n    av_buffer_unref(&pkt->buf);\n    av_init_packet(pkt);\n    pkt->data = NULL;\n    pkt->size = 0;\n}', 'void av_packet_free_side_data(AVPacket *pkt)\n{\n    int i;\n    for (i = 0; i < pkt->side_data_elems; i++)\n        av_free(pkt->side_data[i].data);\n    av_freep(&pkt->side_data);\n    pkt->side_data_elems = 0;\n}', 'void av_buffer_unref(AVBufferRef **buf)\n{\n    AVBuffer *b;\n    if (!buf || !*buf)\n        return;\n    b = (*buf)->buffer;\n    av_freep(buf);\n    if (atomic_fetch_add_explicit(&b->refcount, -1, memory_order_acq_rel) == 1) {\n        b->free(b->opaque, b->data);\n        av_freep(&b);\n    }\n}', 'void av_init_packet(AVPacket *pkt)\n{\n    pkt->pts                  = AV_NOPTS_VALUE;\n    pkt->dts                  = AV_NOPTS_VALUE;\n    pkt->pos                  = -1;\n    pkt->duration             = 0;\n#if FF_API_CONVERGENCE_DURATION\nFF_DISABLE_DEPRECATION_WARNINGS\n    pkt->convergence_duration = 0;\nFF_ENABLE_DEPRECATION_WARNINGS\n#endif\n    pkt->flags                = 0;\n    pkt->stream_index         = 0;\n    pkt->buf                  = NULL;\n    pkt->side_data            = NULL;\n    pkt->side_data_elems      = 0;\n}', 'int av_packet_ref(AVPacket *dst, const AVPacket *src)\n{\n    int ret;\n    ret = av_packet_copy_props(dst, src);\n    if (ret < 0)\n        return ret;\n    if (!src->buf) {\n        ret = packet_alloc(&dst->buf, src->size);\n        if (ret < 0)\n            goto fail;\n        memcpy(dst->buf->data, src->data, src->size);\n        dst->data = dst->buf->data;\n    } else {\n        dst->buf = av_buffer_ref(src->buf);\n        if (!dst->buf) {\n            ret = AVERROR(ENOMEM);\n            goto fail;\n        }\n        dst->data = src->data;\n    }\n    dst->size = src->size;\n    return 0;\nfail:\n    av_packet_free_side_data(dst);\n    return ret;\n}', 'int av_packet_copy_props(AVPacket *dst, const AVPacket *src)\n{\n    int i;\n    dst->pts                  = src->pts;\n    dst->dts                  = src->dts;\n    dst->pos                  = src->pos;\n    dst->duration             = src->duration;\n#if FF_API_CONVERGENCE_DURATION\nFF_DISABLE_DEPRECATION_WARNINGS\n    dst->convergence_duration = src->convergence_duration;\nFF_ENABLE_DEPRECATION_WARNINGS\n#endif\n    dst->flags                = src->flags;\n    dst->stream_index         = src->stream_index;\n    for (i = 0; i < src->side_data_elems; i++) {\n         enum AVPacketSideDataType type = src->side_data[i].type;\n         int size          = src->side_data[i].size;\n         uint8_t *src_data = src->side_data[i].data;\n         uint8_t *dst_data = av_packet_new_side_data(dst, type, size);\n        if (!dst_data) {\n            av_packet_free_side_data(dst);\n            return AVERROR(ENOMEM);\n        }\n        memcpy(dst_data, src_data, size);\n    }\n    return 0;\n}', 'static int packet_alloc(AVBufferRef **buf, int size)\n{\n    int ret;\n    if (size < 0 || size >= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)\n        return AVERROR(EINVAL);\n    ret = av_buffer_realloc(buf, size + AV_INPUT_BUFFER_PADDING_SIZE);\n    if (ret < 0)\n        return ret;\n    memset((*buf)->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);\n    return 0;\n}', 'int av_buffer_realloc(AVBufferRef **pbuf, int size)\n{\n    AVBufferRef *buf = *pbuf;\n    uint8_t *tmp;\n    if (!buf) {\n        uint8_t *data = av_realloc(NULL, size);\n        if (!data)\n            return AVERROR(ENOMEM);\n        buf = av_buffer_create(data, size, av_buffer_default_free, NULL, 0);\n        if (!buf) {\n            av_freep(&data);\n            return AVERROR(ENOMEM);\n        }\n        buf->buffer->flags |= BUFFER_FLAG_REALLOCATABLE;\n        *pbuf = buf;\n        return 0;\n    } else if (buf->size == size)\n        return 0;\n    if (!(buf->buffer->flags & BUFFER_FLAG_REALLOCATABLE) ||\n        !av_buffer_is_writable(buf) || buf->data != buf->buffer->data) {\n        AVBufferRef *new = NULL;\n        av_buffer_realloc(&new, size);\n        if (!new)\n            return AVERROR(ENOMEM);\n        memcpy(new->data, buf->data, FFMIN(size, buf->size));\n        av_buffer_unref(pbuf);\n        *pbuf = new;\n        return 0;\n    }\n    tmp = av_realloc(buf->buffer->data, size);\n    if (!tmp)\n        return AVERROR(ENOMEM);\n    buf->buffer->data = buf->data = tmp;\n    buf->buffer->size = buf->size = size;\n    return 0;\n}', 'int av_buffer_is_writable(const AVBufferRef *buf)\n{\n    if (buf->buffer->flags & AV_BUFFER_FLAG_READONLY)\n        return 0;\n    return atomic_load(&buf->buffer->refcount) == 1;\n}', 'void *av_realloc(void *ptr, size_t size)\n{\n    if (size > (INT_MAX - 16))\n        return NULL;\n#if HAVE_ALIGNED_MALLOC\n    return _aligned_realloc(ptr, size, 32);\n#else\n    return realloc(ptr, size);\n#endif\n}']