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

libavcodec/shorten.c:270:1: start of procedure shorten_decode_frame()
268. 
269. 
270. static int shorten_decode_frame(AVCodecContext *avctx,
     ^
271.         void *data, int *data_size,
272.         AVPacket *avpkt)

libavcodec/shorten.c:274:5: 
272.         AVPacket *avpkt)
273. {
274.     const uint8_t *buf = avpkt->data;
         ^
275.     int buf_size = avpkt->size;
276.     ShortenContext *s = avctx->priv_data;

libavcodec/shorten.c:275:5: 
273. {
274.     const uint8_t *buf = avpkt->data;
275.     int buf_size = avpkt->size;
         ^
276.     ShortenContext *s = avctx->priv_data;
277.     int i, input_buf_size = 0;

libavcodec/shorten.c:276:5: 
274.     const uint8_t *buf = avpkt->data;
275.     int buf_size = avpkt->size;
276.     ShortenContext *s = avctx->priv_data;
         ^
277.     int i, input_buf_size = 0;
278.     int16_t *samples = data;

libavcodec/shorten.c:277:5: 
275.     int buf_size = avpkt->size;
276.     ShortenContext *s = avctx->priv_data;
277.     int i, input_buf_size = 0;
         ^
278.     int16_t *samples = data;
279.     if(s->max_framesize == 0){

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

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

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

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

libavcodec/utils.c:69:1: start of procedure av_fast_realloc()
  67. static int volatile entangled_thread_counter=0;
  68. 
  69. void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size)
      ^
  70. {
  71.     if(min_size < *size)

libavcodec/utils.c:71:8: Taking false branch
  69. void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size)
  70. {
  71.     if(min_size < *size)
             ^
  72.         return ptr;
  73. 

libavcodec/utils.c:74:12: Condition is true
  72.         return ptr;
  73. 
  74.     *size= FFMAX(17*min_size/16 + 32, min_size);
                 ^
  75. 
  76.     ptr= av_realloc(ptr, *size);

libavcodec/utils.c:74:5: 
  72.         return ptr;
  73. 
  74.     *size= FFMAX(17*min_size/16 + 32, min_size);
          ^
  75. 
  76.     ptr= av_realloc(ptr, *size);

libavcodec/utils.c:76:5: 
  74.     *size= FFMAX(17*min_size/16 + 32, min_size);
  75. 
  76.     ptr= av_realloc(ptr, *size);
          ^
  77.     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
  78.         *size= 0;

libavutil/mem.c:102:1: start of procedure av_realloc()
    100. }
    101. 
    102. void *av_realloc(void *ptr, unsigned int size)
         ^
    103. {
    104. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:109:8: Taking false branch
    107. 
    108.     /* let's disallow possible ambiguous cases */
    109.     if(size > (INT_MAX-16) )
                ^
    110.         return NULL;
    111. 

libavutil/mem.c:118:5: 
    116.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
    117. #else
    118.     return realloc(ptr, size);
             ^
    119. #endif
    120. }

libavutil/mem.c:120:1: return from a call to av_realloc
    118.     return realloc(ptr, size);
    119. #endif
    120. }
         ^
    121. 
    122. void av_free(void *ptr)

libavcodec/utils.c:77:9: Taking true branch
  75. 
  76.     ptr= av_realloc(ptr, *size);
  77.     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
              ^
  78.         *size= 0;
  79. 

libavcodec/utils.c:78:9: 
  76.     ptr= av_realloc(ptr, *size);
  77.     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
  78.         *size= 0;
              ^
  79. 
  80.     return ptr;

libavcodec/utils.c:80:5: 
  78.         *size= 0;
  79. 
  80.     return ptr;
          ^
  81. }
  82. 

libavcodec/utils.c:81:1: return from a call to av_fast_realloc
  79. 
  80.     return ptr;
  81. }
      ^
  82. 
  83. void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size)

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

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

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

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

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

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

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