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

libavcodec/utils.c:355:1: start of procedure avcodec_default_release_buffer()
353. }
354. 
355. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     ^
356.     int i;
357.     InternalBuffer *buf, *last;

libavcodec/utils.c:359:5: 
357.     InternalBuffer *buf, *last;
358. 
359.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
         ^
360.     assert(s->internal_buffer_count);
361. 

libavcodec/utils.c:360:5: 
358. 
359.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
360.     assert(s->internal_buffer_count);
         ^
361. 
362.     buf = NULL; /* avoids warning */

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

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

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

libavcodec/utils.c:368:5: 
366.             break;
367.     }
368.     assert(i < s->internal_buffer_count);
         ^
369.     s->internal_buffer_count--;
370.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];

libavcodec/utils.c:369:5: 
367.     }
368.     assert(i < s->internal_buffer_count);
369.     s->internal_buffer_count--;
         ^
370.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
371. 

libavcodec/utils.c:370:5: 
368.     assert(i < s->internal_buffer_count);
369.     s->internal_buffer_count--;
370.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
         ^
371. 
372.     FFSWAP(InternalBuffer, *buf, *last);

libavcodec/utils.c:372:5: 
370.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
371. 
372.     FFSWAP(InternalBuffer, *buf, *last);
         ^
373. 
374.     for(i=0; i<4; i++){
