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

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

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

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

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

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

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

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

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

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

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