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

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

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

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

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

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

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

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

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

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

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