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

libavcodec/utils.c:360:1: start of procedure avcodec_default_release_buffer()
358. }
359. 
360. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     ^
361.     int i;
362.     InternalBuffer *buf, *last;

libavcodec/utils.c:364:5: 
362.     InternalBuffer *buf, *last;
363. 
364.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
         ^
365.     assert(s->internal_buffer_count);
366. 

libavcodec/utils.c:365:5: 
363. 
364.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
365.     assert(s->internal_buffer_count);
         ^
366. 
367.     if(s->internal_buffer){

libavcodec/utils.c:367:8: Taking true branch
365.     assert(s->internal_buffer_count);
366. 
367.     if(s->internal_buffer){
            ^
368.     buf = NULL; /* avoids warning */
369.     for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize

libavcodec/utils.c:368:5: 
366. 
367.     if(s->internal_buffer){
368.     buf = NULL; /* avoids warning */
         ^
369.     for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize
370.         buf= &((InternalBuffer*)s->internal_buffer)[i];

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

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

libavcodec/utils.c:374:5: 
372.             break;
373.     }
374.     assert(i < s->internal_buffer_count);
         ^
375.     s->internal_buffer_count--;
376.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];

libavcodec/utils.c:375:5: 
373.     }
374.     assert(i < s->internal_buffer_count);
375.     s->internal_buffer_count--;
         ^
376.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
377. 

libavcodec/utils.c:376:5: 
374.     assert(i < s->internal_buffer_count);
375.     s->internal_buffer_count--;
376.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
         ^
377. 
378.     FFSWAP(InternalBuffer, *buf, *last);

libavcodec/utils.c:378:5: 
376.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
377. 
378.     FFSWAP(InternalBuffer, *buf, *last);
         ^
379.     }
380. 
