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

libavcodec/utils.c:510:1: start of procedure avcodec_default_release_buffer()
508. }
509. 
510. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     ^
511.     int i;
512.     InternalBuffer *buf, *last;

libavcodec/utils.c:513:5: 
511.     int i;
512.     InternalBuffer *buf, *last;
513.     AVCodecInternal *avci = s->internal;
         ^
514. 
515.     assert(s->codec_type == AVMEDIA_TYPE_VIDEO);

libavcodec/utils.c:515:5: 
513.     AVCodecInternal *avci = s->internal;
514. 
515.     assert(s->codec_type == AVMEDIA_TYPE_VIDEO);
         ^
516. 
517.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);

libavcodec/utils.c:517:5: 
515.     assert(s->codec_type == AVMEDIA_TYPE_VIDEO);
516. 
517.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
         ^
518.     assert(avci->buffer_count);
519. 

libavcodec/utils.c:518:5: 
516. 
517.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
518.     assert(avci->buffer_count);
         ^
519. 
520.     if (avci->buffer) {

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

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

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

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

libavcodec/utils.c:527:9: 
525.                 break;
526.         }
527.         assert(i < avci->buffer_count);
             ^
528.         avci->buffer_count--;
529.         last = &avci->buffer[avci->buffer_count];

libavcodec/utils.c:528:9: 
526.         }
527.         assert(i < avci->buffer_count);
528.         avci->buffer_count--;
             ^
529.         last = &avci->buffer[avci->buffer_count];
530. 

libavcodec/utils.c:529:9: 
527.         assert(i < avci->buffer_count);
528.         avci->buffer_count--;
529.         last = &avci->buffer[avci->buffer_count];
             ^
530. 
531.         if (buf != last)

libavcodec/utils.c:531:13: Taking true branch
529.         last = &avci->buffer[avci->buffer_count];
530. 
531.         if (buf != last)
                 ^
532.             FFSWAP(InternalBuffer, *buf, *last);
533.     }

libavcodec/utils.c:532:13: 
530. 
531.         if (buf != last)
532.             FFSWAP(InternalBuffer, *buf, *last);
                 ^
533.     }
534. 
