libavcodec/utils.c:552: error: Null Dereference
  pointer `buf` last assigned on line 541 could be null and is dereferenced at line 552, column 13.

libavcodec/utils.c:529:1: start of procedure avcodec_default_release_buffer()
527. }
528. 
529. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
     ^
530. {
531.     int i;

libavcodec/utils.c:533:5: 
531.     int i;
532.     InternalBuffer *buf, *last;
533.     AVCodecInternal *avci = s->internal;
         ^
534. 
535.     assert(s->codec_type == AVMEDIA_TYPE_VIDEO);

libavcodec/utils.c:535:5: 
533.     AVCodecInternal *avci = s->internal;
534. 
535.     assert(s->codec_type == AVMEDIA_TYPE_VIDEO);
         ^
536. 
537.     assert(pic->type == FF_BUFFER_TYPE_INTERNAL);

libavcodec/utils.c:537:5: 
535.     assert(s->codec_type == AVMEDIA_TYPE_VIDEO);
536. 
537.     assert(pic->type == FF_BUFFER_TYPE_INTERNAL);
         ^
538.     assert(avci->buffer_count);
539. 

libavcodec/utils.c:538:5: 
536. 
537.     assert(pic->type == FF_BUFFER_TYPE_INTERNAL);
538.     assert(avci->buffer_count);
         ^
539. 
540.     if (avci->buffer) {

libavcodec/utils.c:540:9: Taking true branch
538.     assert(avci->buffer_count);
539. 
540.     if (avci->buffer) {
             ^
541.         buf = NULL; /* avoids warning */
542.         for (i = 0; i < avci->buffer_count; i++) { //just 3-5 checks so is not worth to optimize

libavcodec/utils.c:541:9: 
539. 
540.     if (avci->buffer) {
541.         buf = NULL; /* avoids warning */
             ^
542.         for (i = 0; i < avci->buffer_count; i++) { //just 3-5 checks so is not worth to optimize
543.             buf = &avci->buffer[i];

libavcodec/utils.c:542:14: 
540.     if (avci->buffer) {
541.         buf = NULL; /* avoids warning */
542.         for (i = 0; i < avci->buffer_count; i++) { //just 3-5 checks so is not worth to optimize
                  ^
543.             buf = &avci->buffer[i];
544.             if (buf->data[0] == pic->data[0])

libavcodec/utils.c:542:21: Loop condition is false. Leaving loop
540.     if (avci->buffer) {
541.         buf = NULL; /* avoids warning */
542.         for (i = 0; i < avci->buffer_count; i++) { //just 3-5 checks so is not worth to optimize
                         ^
543.             buf = &avci->buffer[i];
544.             if (buf->data[0] == pic->data[0])

libavcodec/utils.c:547:9: 
545.                 break;
546.         }
547.         assert(i < avci->buffer_count);
             ^
548.         avci->buffer_count--;
549.         last = &avci->buffer[avci->buffer_count];

libavcodec/utils.c:548:9: 
546.         }
547.         assert(i < avci->buffer_count);
548.         avci->buffer_count--;
             ^
549.         last = &avci->buffer[avci->buffer_count];
550. 

libavcodec/utils.c:549:9: 
547.         assert(i < avci->buffer_count);
548.         avci->buffer_count--;
549.         last = &avci->buffer[avci->buffer_count];
             ^
550. 
551.         if (buf != last)

libavcodec/utils.c:551:13: Taking true branch
549.         last = &avci->buffer[avci->buffer_count];
550. 
551.         if (buf != last)
                 ^
552.             FFSWAP(InternalBuffer, *buf, *last);
553.     }

libavcodec/utils.c:552:13: 
550. 
551.         if (buf != last)
552.             FFSWAP(InternalBuffer, *buf, *last);
                 ^
553.     }
554. 
