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

libavcodec/utils.c:344:1: start of procedure avcodec_default_release_buffer()
342. }
343. 
344. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     ^
345.     int i;
346.     InternalBuffer *buf, *last;

libavcodec/utils.c:348:5: 
346.     InternalBuffer *buf, *last;
347. 
348.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
         ^
349.     assert(s->internal_buffer_count);
350. 

libavcodec/utils.c:349:5: 
347. 
348.     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
349.     assert(s->internal_buffer_count);
         ^
350. 
351.     buf = NULL; /* avoids warning */

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

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

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

libavcodec/utils.c:357:5: 
355.             break;
356.     }
357.     assert(i < s->internal_buffer_count);
         ^
358.     s->internal_buffer_count--;
359.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];

libavcodec/utils.c:358:5: 
356.     }
357.     assert(i < s->internal_buffer_count);
358.     s->internal_buffer_count--;
         ^
359.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
360. 

libavcodec/utils.c:359:5: 
357.     assert(i < s->internal_buffer_count);
358.     s->internal_buffer_count--;
359.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
         ^
360. 
361.     FFSWAP(InternalBuffer, *buf, *last);

libavcodec/utils.c:361:5: 
359.     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
360. 
361.     FFSWAP(InternalBuffer, *buf, *last);
         ^
362. 
363.     for(i=0; i<4; i++){
