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

libavcodec/utils.c:290:1: start of procedure avcodec_default_release_buffer()
288. }
289. 
290. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     ^
291.     int i;
292.     InternalBuffer *buf, *last;

libavcodec/utils.c:294:5: 
292.     InternalBuffer *buf, *last;
293. 
294.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
         ^
295.     assert(s->internal_buffer_count);
296. 

libavcodec/utils.c:295:5: 
293. 
294.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
295.     assert(s->internal_buffer_count);
         ^
296. 
297.     buf = NULL; /* avoids warning */

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

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

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

libavcodec/utils.c:303:5: 
301.             break;
302.     }
303.     assert(i < s->internal_buffer_count);
         ^
304.     s->internal_buffer_count--;
305.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];

libavcodec/utils.c:304:5: 
302.     }
303.     assert(i < s->internal_buffer_count);
304.     s->internal_buffer_count--;
         ^
305.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
306. 

libavcodec/utils.c:305:5: 
303.     assert(i < s->internal_buffer_count);
304.     s->internal_buffer_count--;
305.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
         ^
306. 
307.     FFSWAP(InternalBuffer, *buf, *last);

libavcodec/utils.c:307:5: 
305.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
306. 
307.     FFSWAP(InternalBuffer, *buf, *last);
         ^
308. 
309.     for(i=0; i<4; i++){
