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

libavcodec/utils.c:373:1: start of procedure avcodec_default_release_buffer()
371. }
372. 
373. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     ^
374.     int i;
375.     InternalBuffer *buf, *last;

libavcodec/utils.c:376:5: 
374.     int i;
375.     InternalBuffer *buf, *last;
376.     AVCodecInternal *avci = s->internal;
         ^
377. 
378.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);

libavcodec/utils.c:378:5: 
376.     AVCodecInternal *avci = s->internal;
377. 
378.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
         ^
379.     assert(avci->buffer_count);
380. 

libavcodec/utils.c:379:5: 
377. 
378.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
379.     assert(avci->buffer_count);
         ^
380. 
381.     if (avci->buffer) {

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

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

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

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

libavcodec/utils.c:388:9: 
386.                 break;
387.         }
388.         assert(i < avci->buffer_count);
             ^
389.         avci->buffer_count--;
390.         last = &avci->buffer[avci->buffer_count];

libavcodec/utils.c:389:9: 
387.         }
388.         assert(i < avci->buffer_count);
389.         avci->buffer_count--;
             ^
390.         last = &avci->buffer[avci->buffer_count];
391. 

libavcodec/utils.c:390:9: 
388.         assert(i < avci->buffer_count);
389.         avci->buffer_count--;
390.         last = &avci->buffer[avci->buffer_count];
             ^
391. 
392.         FFSWAP(InternalBuffer, *buf, *last);

libavcodec/utils.c:392:9: 
390.         last = &avci->buffer[avci->buffer_count];
391. 
392.         FFSWAP(InternalBuffer, *buf, *last);
             ^
393.     }
394. 
