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

libavcodec/shorten.c:278:1: start of procedure shorten_decode_frame()
276. 
277. 
278. static int shorten_decode_frame(AVCodecContext *avctx,
     ^
279.         void *data, int *data_size,
280.         AVPacket *avpkt)

libavcodec/shorten.c:282:5: 
280.         AVPacket *avpkt)
281. {
282.     const uint8_t *buf = avpkt->data;
         ^
283.     int buf_size = avpkt->size;
284.     ShortenContext *s = avctx->priv_data;

libavcodec/shorten.c:283:5: 
281. {
282.     const uint8_t *buf = avpkt->data;
283.     int buf_size = avpkt->size;
         ^
284.     ShortenContext *s = avctx->priv_data;
285.     int i, input_buf_size = 0;

libavcodec/shorten.c:284:5: 
282.     const uint8_t *buf = avpkt->data;
283.     int buf_size = avpkt->size;
284.     ShortenContext *s = avctx->priv_data;
         ^
285.     int i, input_buf_size = 0;
286.     int16_t *samples = data;

libavcodec/shorten.c:285:5: 
283.     int buf_size = avpkt->size;
284.     ShortenContext *s = avctx->priv_data;
285.     int i, input_buf_size = 0;
         ^
286.     int16_t *samples = data;
287.     if(s->max_framesize == 0){

libavcodec/shorten.c:286:5: 
284.     ShortenContext *s = avctx->priv_data;
285.     int i, input_buf_size = 0;
286.     int16_t *samples = data;
         ^
287.     if(s->max_framesize == 0){
288.         s->max_framesize= 1024; // should hopefully be enough for the first header

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

libavcodec/shorten.c:288:9: 
286.     int16_t *samples = data;
287.     if(s->max_framesize == 0){
288.         s->max_framesize= 1024; // should hopefully be enough for the first header
             ^
289.         s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
290.     }

libavcodec/shorten.c:289:9: 
287.     if(s->max_framesize == 0){
288.         s->max_framesize= 1024; // should hopefully be enough for the first header
289.         s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
             ^
290.     }
291. 

libavcodec/utils.c:51:1: start of procedure av_fast_realloc()
  49. static void *codec_mutex;
  50. 
  51. void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
      ^
  52. {
  53.     if(min_size < *size)

libavcodec/utils.c:53:8: Taking false branch
  51. void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
  52. {
  53.     if(min_size < *size)
             ^
  54.         return ptr;
  55. 

libavcodec/utils.c:56:15: Condition is true
  54.         return ptr;
  55. 
  56.     min_size= FFMAX(17*min_size/16 + 32, min_size);
                    ^
  57. 
  58.     ptr= av_realloc(ptr, min_size);

libavcodec/utils.c:56:5: 
  54.         return ptr;
  55. 
  56.     min_size= FFMAX(17*min_size/16 + 32, min_size);
          ^
  57. 
  58.     ptr= av_realloc(ptr, min_size);

libavcodec/utils.c:58:5: 
  56.     min_size= FFMAX(17*min_size/16 + 32, min_size);
  57. 
  58.     ptr= av_realloc(ptr, min_size);
          ^
  59.     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
  60.         min_size= 0;

libavutil/mem.c:117:1: start of procedure av_realloc()
    115. }
    116. 
    117. void *av_realloc(void *ptr, size_t size)
         ^
    118. {
    119. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:124:8: Taking false branch
    122. 
    123.     /* let's disallow possible ambiguous cases */
    124.     if(size > (INT_MAX-16) )
                ^
    125.         return NULL;
    126. 

libavutil/mem.c:133:5: 
    131.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
    132. #else
    133.     return realloc(ptr, size);
             ^
    134. #endif
    135. }

libavutil/mem.c:135:1: return from a call to av_realloc
    133.     return realloc(ptr, size);
    134. #endif
    135. }
         ^
    136. 
    137. void av_free(void *ptr)

libavcodec/utils.c:59:9: Taking true branch
  57. 
  58.     ptr= av_realloc(ptr, min_size);
  59.     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
              ^
  60.         min_size= 0;
  61. 

libavcodec/utils.c:60:9: 
  58.     ptr= av_realloc(ptr, min_size);
  59.     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
  60.         min_size= 0;
              ^
  61. 
  62.     *size= min_size;

libavcodec/utils.c:62:5: 
  60.         min_size= 0;
  61. 
  62.     *size= min_size;
          ^
  63. 
  64.     return ptr;

libavcodec/utils.c:64:5: 
  62.     *size= min_size;
  63. 
  64.     return ptr;
          ^
  65. }
  66. 

libavcodec/utils.c:65:1: return from a call to av_fast_realloc
  63. 
  64.     return ptr;
  65. }
      ^
  66. 
  67. void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)

libavcodec/shorten.c:292:8: Taking true branch
290.     }
291. 
292.     if(1 && s->max_framesize){//FIXME truncated
            ^
293.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
294.         input_buf_size= buf_size;

libavcodec/shorten.c:292:13: Taking true branch
290.     }
291. 
292.     if(1 && s->max_framesize){//FIXME truncated
                 ^
293.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
294.         input_buf_size= buf_size;

libavcodec/shorten.c:293:19: Condition is true
291. 
292.     if(1 && s->max_framesize){//FIXME truncated
293.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
                       ^
294.         input_buf_size= buf_size;
295. 

libavcodec/shorten.c:293:9: 
291. 
292.     if(1 && s->max_framesize){//FIXME truncated
293.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
             ^
294.         input_buf_size= buf_size;
295. 

libavcodec/shorten.c:294:9: 
292.     if(1 && s->max_framesize){//FIXME truncated
293.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
294.         input_buf_size= buf_size;
             ^
295. 
296.         if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){

libavcodec/shorten.c:296:12: Taking true branch
294.         input_buf_size= buf_size;
295. 
296.         if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){
                ^
297.             //                printf("memmove\n");
298.             memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);

libavcodec/shorten.c:298:13: 
296.         if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){
297.             //                printf("memmove\n");
298.             memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);
                 ^
299.             s->bitstream_index=0;
300.         }
