libavcodec/mdec.c:177: error: Null Dereference
  pointer `a->bitstream_buffer` last assigned on line 175 could be null and is dereferenced at line 177, column 9.

libavcodec/mdec.c:155:1: start of procedure decode_frame()
153. }
154. 
155. static int decode_frame(AVCodecContext *avctx,
     ^
156.                         void *data, int *data_size,
157.                         const uint8_t *buf, int buf_size)

libavcodec/mdec.c:159:5: 
157.                         const uint8_t *buf, int buf_size)
158. {
159.     MDECContext * const a = avctx->priv_data;
         ^
160.     AVFrame *picture = data;
161.     AVFrame * const p= &a->picture;

libavcodec/mdec.c:160:5: 
158. {
159.     MDECContext * const a = avctx->priv_data;
160.     AVFrame *picture = data;
         ^
161.     AVFrame * const p= &a->picture;
162.     int i;

libavcodec/mdec.c:161:5: 
159.     MDECContext * const a = avctx->priv_data;
160.     AVFrame *picture = data;
161.     AVFrame * const p= &a->picture;
         ^
162.     int i;
163. 

libavcodec/mdec.c:164:8: Taking true branch
162.     int i;
163. 
164.     if(p->data[0])
            ^
165.         avctx->release_buffer(avctx, p);
166. 

libavcodec/mdec.c:165:9: Skipping __function_pointer__(): unresolved function pointer
163. 
164.     if(p->data[0])
165.         avctx->release_buffer(avctx, p);
             ^
166. 
167.     p->reference= 0;

libavcodec/mdec.c:167:5: 
165.         avctx->release_buffer(avctx, p);
166. 
167.     p->reference= 0;
         ^
168.     if(avctx->get_buffer(avctx, p) < 0){
169.         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

libavcodec/mdec.c:168:8: Taking false branch
166. 
167.     p->reference= 0;
168.     if(avctx->get_buffer(avctx, p) < 0){
            ^
169.         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
170.         return -1;

libavcodec/mdec.c:172:5: 
170.         return -1;
171.     }
172.     p->pict_type= FF_I_TYPE;
         ^
173.     p->key_frame= 1;
174. 

libavcodec/mdec.c:173:5: 
171.     }
172.     p->pict_type= FF_I_TYPE;
173.     p->key_frame= 1;
         ^
174. 
175.     a->bitstream_buffer= av_fast_realloc(a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);

libavcodec/mdec.c:175:5: 
173.     p->key_frame= 1;
174. 
175.     a->bitstream_buffer= av_fast_realloc(a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
         ^
176.     for(i=0; i<buf_size; i+=2){
177.         a->bitstream_buffer[i]  = buf[i+1];

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

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

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

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

libavcodec/utils.c:74:5: 
  72.     *size= FFMAX(17*min_size/16 + 32, min_size);
  73. 
  74.     ptr= av_realloc(ptr, *size);
          ^
  75.     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
  76.         *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 true branch
     99. 
    100.     /* let's disallow possible ambiguous cases */
    101.     if(size > (INT_MAX-16) )
                ^
    102.         return NULL;
    103. 

libavutil/mem.c:102:9: 
    100.     /* let's disallow possible ambiguous cases */
    101.     if(size > (INT_MAX-16) )
    102.         return NULL;
                 ^
    103. 
    104. #ifdef CONFIG_MEMALIGN_HACK

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:75:9: Taking true branch
  73. 
  74.     ptr= av_realloc(ptr, *size);
  75.     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
              ^
  76.         *size= 0;
  77. 

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

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

libavcodec/utils.c:79:1: return from a call to av_fast_realloc
  77. 
  78.     return ptr;
  79. }
      ^
  80. 
  81. /* encoder management */

libavcodec/mdec.c:176:9: 
174. 
175.     a->bitstream_buffer= av_fast_realloc(a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
176.     for(i=0; i<buf_size; i+=2){
             ^
177.         a->bitstream_buffer[i]  = buf[i+1];
178.         a->bitstream_buffer[i+1]= buf[i  ];

libavcodec/mdec.c:176:14: Loop condition is true. Entering loop body
174. 
175.     a->bitstream_buffer= av_fast_realloc(a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
176.     for(i=0; i<buf_size; i+=2){
                  ^
177.         a->bitstream_buffer[i]  = buf[i+1];
178.         a->bitstream_buffer[i+1]= buf[i  ];

libavcodec/mdec.c:177:9: 
175.     a->bitstream_buffer= av_fast_realloc(a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
176.     for(i=0; i<buf_size; i+=2){
177.         a->bitstream_buffer[i]  = buf[i+1];
             ^
178.         a->bitstream_buffer[i+1]= buf[i  ];
179.     }
