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

libavcodec/shorten.c:344:1: start of procedure shorten_decode_frame()
342. }
343. 
344. static int shorten_decode_frame(AVCodecContext *avctx,
     ^
345.         void *data, int *data_size,
346.         AVPacket *avpkt)

libavcodec/shorten.c:348:5: 
346.         AVPacket *avpkt)
347. {
348.     const uint8_t *buf = avpkt->data;
         ^
349.     int buf_size = avpkt->size;
350.     ShortenContext *s = avctx->priv_data;

libavcodec/shorten.c:349:5: 
347. {
348.     const uint8_t *buf = avpkt->data;
349.     int buf_size = avpkt->size;
         ^
350.     ShortenContext *s = avctx->priv_data;
351.     int i, input_buf_size = 0;

libavcodec/shorten.c:350:5: 
348.     const uint8_t *buf = avpkt->data;
349.     int buf_size = avpkt->size;
350.     ShortenContext *s = avctx->priv_data;
         ^
351.     int i, input_buf_size = 0;
352.     int16_t *samples = data;

libavcodec/shorten.c:351:5: 
349.     int buf_size = avpkt->size;
350.     ShortenContext *s = avctx->priv_data;
351.     int i, input_buf_size = 0;
         ^
352.     int16_t *samples = data;
353.     if(s->max_framesize == 0){

libavcodec/shorten.c:352:5: 
350.     ShortenContext *s = avctx->priv_data;
351.     int i, input_buf_size = 0;
352.     int16_t *samples = data;
         ^
353.     if(s->max_framesize == 0){
354.         s->max_framesize= 1024; // should hopefully be enough for the first header

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

libavcodec/shorten.c:354:9: 
352.     int16_t *samples = data;
353.     if(s->max_framesize == 0){
354.         s->max_framesize= 1024; // should hopefully be enough for the first header
             ^
355.         s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
356.     }

libavcodec/shorten.c:355:9: 
353.     if(s->max_framesize == 0){
354.         s->max_framesize= 1024; // should hopefully be enough for the first header
355.         s->bitstream= av_fast_realloc(s->bitstream, &s->allocated_bitstream_size, s->max_framesize);
             ^
356.     }
357. 

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

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

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

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

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

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

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

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

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

libavcodec/shorten.c:358:8: Taking true branch
356.     }
357. 
358.     if(1 && s->max_framesize){//FIXME truncated
            ^
359.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
360.         input_buf_size= buf_size;

libavcodec/shorten.c:358:13: Taking true branch
356.     }
357. 
358.     if(1 && s->max_framesize){//FIXME truncated
                 ^
359.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
360.         input_buf_size= buf_size;

libavcodec/shorten.c:359:19: Condition is false
357. 
358.     if(1 && s->max_framesize){//FIXME truncated
359.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
                       ^
360.         input_buf_size= buf_size;
361. 

libavcodec/shorten.c:359:9: 
357. 
358.     if(1 && s->max_framesize){//FIXME truncated
359.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
             ^
360.         input_buf_size= buf_size;
361. 

libavcodec/shorten.c:360:9: 
358.     if(1 && s->max_framesize){//FIXME truncated
359.         buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
360.         input_buf_size= buf_size;
             ^
361. 
362.         if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){

libavcodec/shorten.c:362:12: Taking true branch
360.         input_buf_size= buf_size;
361. 
362.         if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){
                ^
363.             //                printf("memmove\n");
364.             memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);

libavcodec/shorten.c:364:13: 
362.         if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){
363.             //                printf("memmove\n");
364.             memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);
                 ^
365.             s->bitstream_index=0;
366.         }
