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

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

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

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

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

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

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

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

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

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

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

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