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

libavcodec/utils.c:311:1: start of procedure avcodec_default_release_buffer()
309. }
310. 
311. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     ^
312.     int i;
313.     InternalBuffer *buf, *last;

libavcodec/utils.c:315:5: 
313.     InternalBuffer *buf, *last;
314. 
315.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
         ^
316.     assert(s->internal_buffer_count);
317. 

libavcodec/utils.c:316:5: 
314. 
315.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
316.     assert(s->internal_buffer_count);
         ^
317. 
318.     buf = NULL; /* avoids warning */

libavcodec/utils.c:318:5: 
316.     assert(s->internal_buffer_count);
317. 
318.     buf = NULL; /* avoids warning */
         ^
319.     for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize
320.         buf= &((InternalBuffer*)s->internal_buffer)[i];

libavcodec/utils.c:319:9: 
317. 
318.     buf = NULL; /* avoids warning */
319.     for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize
             ^
320.         buf= &((InternalBuffer*)s->internal_buffer)[i];
321.         if(buf->data[0] == pic->data[0])

libavcodec/utils.c:319:14: Loop condition is false. Leaving loop
317. 
318.     buf = NULL; /* avoids warning */
319.     for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize
                  ^
320.         buf= &((InternalBuffer*)s->internal_buffer)[i];
321.         if(buf->data[0] == pic->data[0])

libavcodec/utils.c:324:5: 
322.             break;
323.     }
324.     assert(i < s->internal_buffer_count);
         ^
325.     s->internal_buffer_count--;
326.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];

libavcodec/utils.c:325:5: 
323.     }
324.     assert(i < s->internal_buffer_count);
325.     s->internal_buffer_count--;
         ^
326.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
327. 

libavcodec/utils.c:326:5: 
324.     assert(i < s->internal_buffer_count);
325.     s->internal_buffer_count--;
326.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
         ^
327. 
328.     FFSWAP(InternalBuffer, *buf, *last);

libavcodec/utils.c:328:5: 
326.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
327. 
328.     FFSWAP(InternalBuffer, *buf, *last);
         ^
329. 
330.     for(i=0; i<4; i++){
