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

libavcodec/utils.c:375:1: start of procedure avcodec_default_release_buffer()
373. }
374. 
375. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     ^
376.     int i;
377.     InternalBuffer *buf, *last;

libavcodec/utils.c:379:5: 
377.     InternalBuffer *buf, *last;
378. 
379.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
         ^
380.     assert(s->internal_buffer_count);
381. 

libavcodec/utils.c:380:5: 
378. 
379.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
380.     assert(s->internal_buffer_count);
         ^
381. 
382.     if(s->internal_buffer){

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

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

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

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

libavcodec/utils.c:389:5: 
387.             break;
388.     }
389.     assert(i < s->internal_buffer_count);
         ^
390.     s->internal_buffer_count--;
391.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];

libavcodec/utils.c:390:5: 
388.     }
389.     assert(i < s->internal_buffer_count);
390.     s->internal_buffer_count--;
         ^
391.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
392. 

libavcodec/utils.c:391:5: 
389.     assert(i < s->internal_buffer_count);
390.     s->internal_buffer_count--;
391.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
         ^
392. 
393.     FFSWAP(InternalBuffer, *buf, *last);

libavcodec/utils.c:393:5: 
391.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
392. 
393.     FFSWAP(InternalBuffer, *buf, *last);
         ^
394.     }
395. 
