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

libavcodec/utils.c:350:1: start of procedure avcodec_default_release_buffer()
348. }
349. 
350. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     ^
351.     int i;
352.     InternalBuffer *buf, *last;

libavcodec/utils.c:354:5: 
352.     InternalBuffer *buf, *last;
353. 
354.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
         ^
355.     assert(s->internal_buffer_count);
356. 

libavcodec/utils.c:355:5: 
353. 
354.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
355.     assert(s->internal_buffer_count);
         ^
356. 
357.     buf = NULL; /* avoids warning */

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

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

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

libavcodec/utils.c:363:5: 
361.             break;
362.     }
363.     assert(i < s->internal_buffer_count);
         ^
364.     s->internal_buffer_count--;
365.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];

libavcodec/utils.c:364:5: 
362.     }
363.     assert(i < s->internal_buffer_count);
364.     s->internal_buffer_count--;
         ^
365.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
366. 

libavcodec/utils.c:365:5: 
363.     assert(i < s->internal_buffer_count);
364.     s->internal_buffer_count--;
365.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
         ^
366. 
367.     FFSWAP(InternalBuffer, *buf, *last);

libavcodec/utils.c:367:5: 
365.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
366. 
367.     FFSWAP(InternalBuffer, *buf, *last);
         ^
368. 
369.     for(i=0; i<4; i++){
