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

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

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

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

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

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

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

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

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

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

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

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