libavcodec/shorten.c:287: error: Null Dereference
  pointer `s->bitstream` last assigned on line 278 could be null and is dereferenced by call to `memmove()` at line 287, column 13.

libavcodec/shorten.c:269:1: start of procedure shorten_decode_frame()
267. 
268. 
269. static int shorten_decode_frame(AVCodecContext *avctx,
     ^
270.         void *data, int *data_size,
271.         const uint8_t *buf, int buf_size)

libavcodec/shorten.c:273:5: 
271.         const uint8_t *buf, int buf_size)
272. {
273.     ShortenContext *s = avctx->priv_data;
         ^
274.     int i, input_buf_size = 0;
275.     int16_t *samples = data;

libavcodec/shorten.c:274:5: 
272. {
273.     ShortenContext *s = avctx->priv_data;
274.     int i, input_buf_size = 0;
         ^
275.     int16_t *samples = data;
276.     if(s->max_framesize == 0){

libavcodec/shorten.c:275:5: 
273.     ShortenContext *s = avctx->priv_data;
274.     int i, input_buf_size = 0;
275.     int16_t *samples = data;
         ^
276.     if(s->max_framesize == 0){
277.         s->max_framesize= 1024; // should hopefully be enough for the first header

libavcodec/shorten.c:276:8: Taking true branch
274.     int i, input_buf_size = 0;
275.     int16_t *samples = data;
276.     if(s->max_framesize == 0){
            ^
277.         s->max_framesize= 1024; // should hopefully be enough for the first header
278.         s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);

libavcodec/shorten.c:277:9: 
275.     int16_t *samples = data;
276.     if(s->max_framesize == 0){
277.         s->max_framesize= 1024; // should hopefully be enough for the first header
             ^
278.         s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
279.     }

libavcodec/shorten.c:278:9: 
276.     if(s->max_framesize == 0){
277.         s->max_framesize= 1024; // should hopefully be enough for the first header
278.         s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
             ^
279.     }
280. 

libavcodec/utils.c:62:1: start of procedure av_fast_realloc()
  60. static int volatile entangled_thread_counter=0;
  61. 
  62. void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size)
      ^
  63. {
  64.     if(min_size < *size)

libavcodec/utils.c:64:8: Taking false branch
  62. void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size)
  63. {
  64.     if(min_size < *size)
             ^
  65.         return ptr;
  66. 

libavcodec/utils.c:67:12: Condition is true
  65.         return ptr;
  66. 
  67.     *size= FFMAX(17*min_size/16 + 32, min_size);
                 ^
  68. 
  69.     ptr= av_realloc(ptr, *size);

libavcodec/utils.c:67:5: 
  65.         return ptr;
  66. 
  67.     *size= FFMAX(17*min_size/16 + 32, min_size);
          ^
  68. 
  69.     ptr= av_realloc(ptr, *size);

libavcodec/utils.c:69:5: 
  67.     *size= FFMAX(17*min_size/16 + 32, min_size);
  68. 
  69.     ptr= av_realloc(ptr, *size);
          ^
  70.     if(!ptr) //we could set this to the unmodified min_size but this is safer if the user lost the ptr and uses NULL now
  71.         *size= 0;

libavutil/mem.c:94:1: start of procedure av_realloc()
    92. }
    93. 
    94. void *av_realloc(void *ptr, unsigned int size)
        ^
    95. {
    96. #ifdef CONFIG_MEMALIGN_HACK

libavutil/mem.c:101:8: Taking false branch
     99. 
    100.     /* let's disallow possible ambiguous cases */
    101.     if(size > (INT_MAX-16) )
                ^
    102.         return NULL;
    103. 

libavutil/mem.c:110:5: 
    108.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
    109. #else
    110.     return realloc(ptr, size);
             ^
    111. #endif
    112. }

libavutil/mem.c:112:1: return from a call to av_realloc
    110.     return realloc(ptr, size);
    111. #endif
    112. }
         ^
    113. 
    114. void av_free(void *ptr)

libavcodec/utils.c:70:9: Taking true branch
  68. 
  69.     ptr= av_realloc(ptr, *size);
  70.     if(!ptr) //we could set this to the unmodified min_size but this is safer if the user lost the ptr and uses NULL now
              ^
  71.         *size= 0;
  72. 

libavcodec/utils.c:71:9: 
  69.     ptr= av_realloc(ptr, *size);
  70.     if(!ptr) //we could set this to the unmodified min_size but this is safer if the user lost the ptr and uses NULL now
  71.         *size= 0;
              ^
  72. 
  73.     return ptr;

libavcodec/utils.c:73:5: 
  71.         *size= 0;
  72. 
  73.     return ptr;
          ^
  74. }
  75. 

libavcodec/utils.c:74:1: return from a call to av_fast_realloc
  72. 
  73.     return ptr;
  74. }
      ^
  75. 
  76. /* encoder management */

libavcodec/shorten.c:281:8: Taking true branch
279.     }
280. 
281.     if(1 && s->max_framesize){//FIXME truncated
            ^
282.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
283.         input_buf_size= buf_size;

libavcodec/shorten.c:281:13: Taking true branch
279.     }
280. 
281.     if(1 && s->max_framesize){//FIXME truncated
                 ^
282.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
283.         input_buf_size= buf_size;

libavcodec/shorten.c:282:19: Condition is false
280. 
281.     if(1 && s->max_framesize){//FIXME truncated
282.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
                       ^
283.         input_buf_size= buf_size;
284. 

libavcodec/shorten.c:282:9: 
280. 
281.     if(1 && s->max_framesize){//FIXME truncated
282.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
             ^
283.         input_buf_size= buf_size;
284. 

libavcodec/shorten.c:283:9: 
281.     if(1 && s->max_framesize){//FIXME truncated
282.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
283.         input_buf_size= buf_size;
             ^
284. 
285.         if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){

libavcodec/shorten.c:285:12: Taking true branch
283.         input_buf_size= buf_size;
284. 
285.         if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){
                ^
286.             //                printf("memmove\n");
287.             memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);

libavcodec/shorten.c:287:13: 
285.         if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){
286.             //                printf("memmove\n");
287.             memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);
                 ^
288.             s->bitstream_index=0;
289.         }
