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

libavcodec/utils.c:368:1: start of procedure avcodec_default_release_buffer()
366. }
367. 
368. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     ^
369.     int i;
370.     InternalBuffer *buf, *last;

libavcodec/utils.c:371:5: 
369.     int i;
370.     InternalBuffer *buf, *last;
371.     AVCodecInternal *avci = s->internal;
         ^
372. 
373.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);

libavcodec/utils.c:373:5: 
371.     AVCodecInternal *avci = s->internal;
372. 
373.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
         ^
374.     assert(avci->buffer_count);
375. 

libavcodec/utils.c:374:5: 
372. 
373.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
374.     assert(avci->buffer_count);
         ^
375. 
376.     if (avci->buffer) {

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

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

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

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

libavcodec/utils.c:383:9: 
381.                 break;
382.         }
383.         assert(i < avci->buffer_count);
             ^
384.         avci->buffer_count--;
385.         last = &avci->buffer[avci->buffer_count];

libavcodec/utils.c:384:9: 
382.         }
383.         assert(i < avci->buffer_count);
384.         avci->buffer_count--;
             ^
385.         last = &avci->buffer[avci->buffer_count];
386. 

libavcodec/utils.c:385:9: 
383.         assert(i < avci->buffer_count);
384.         avci->buffer_count--;
385.         last = &avci->buffer[avci->buffer_count];
             ^
386. 
387.         FFSWAP(InternalBuffer, *buf, *last);

libavcodec/utils.c:387:9: 
385.         last = &avci->buffer[avci->buffer_count];
386. 
387.         FFSWAP(InternalBuffer, *buf, *last);
             ^
388.     }
389. 
