libavcodec/parser.c:194: error: Null Dereference
  pointer `*poutbuf` last assigned on line 192 could be null and is dereferenced by call to `memcpy()` at line 194, column 13.

libavcodec/parser.c:170:1: start of procedure av_parser_change()
168. }
169. 
170. int av_parser_change(AVCodecParserContext *s,
     ^
171.                      AVCodecContext *avctx,
172.                      uint8_t **poutbuf, int *poutbuf_size,

libavcodec/parser.c:175:8: Taking true branch
173.                      const uint8_t *buf, int buf_size, int keyframe){
174. 
175.     if(s && s->parser->split){
            ^
176.         if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){
177.             int i= s->parser->split(avctx, buf, buf_size);

libavcodec/parser.c:175:13: Taking true branch
173.                      const uint8_t *buf, int buf_size, int keyframe){
174. 
175.     if(s && s->parser->split){
                 ^
176.         if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){
177.             int i= s->parser->split(avctx, buf, buf_size);

libavcodec/parser.c:176:13: Taking true branch
174. 
175.     if(s && s->parser->split){
176.         if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){
                 ^
177.             int i= s->parser->split(avctx, buf, buf_size);
178.             buf += i;

libavcodec/parser.c:177:13: Skipping __function_pointer__(): unresolved function pointer
175.     if(s && s->parser->split){
176.         if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){
177.             int i= s->parser->split(avctx, buf, buf_size);
                 ^
178.             buf += i;
179.             buf_size -= i;

libavcodec/parser.c:178:13: 
176.         if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){
177.             int i= s->parser->split(avctx, buf, buf_size);
178.             buf += i;
                 ^
179.             buf_size -= i;
180.         }

libavcodec/parser.c:179:13: 
177.             int i= s->parser->split(avctx, buf, buf_size);
178.             buf += i;
179.             buf_size -= i;
                 ^
180.         }
181.     }

libavcodec/parser.c:184:5: 
182. 
183.     /* cast to avoid warning about discarding qualifiers */
184.     *poutbuf= (uint8_t *) buf;
         ^
185.     *poutbuf_size= buf_size;
186.     if(avctx->extradata){

libavcodec/parser.c:185:5: 
183.     /* cast to avoid warning about discarding qualifiers */
184.     *poutbuf= (uint8_t *) buf;
185.     *poutbuf_size= buf_size;
         ^
186.     if(avctx->extradata){
187.         if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))

libavcodec/parser.c:186:8: Taking true branch
184.     *poutbuf= (uint8_t *) buf;
185.     *poutbuf_size= buf_size;
186.     if(avctx->extradata){
            ^
187.         if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))
188.             /*||(s->pict_type != AV_PICTURE_TYPE_I && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/

libavcodec/parser.c:187:15: Taking true branch
185.     *poutbuf_size= buf_size;
186.     if(avctx->extradata){
187.         if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))
                   ^
188.             /*||(s->pict_type != AV_PICTURE_TYPE_I && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/
189.             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){

libavcodec/parser.c:187:28: Taking true branch
185.     *poutbuf_size= buf_size;
186.     if(avctx->extradata){
187.         if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))
                                ^
188.             /*||(s->pict_type != AV_PICTURE_TYPE_I && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/
189.             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){

libavcodec/parser.c:190:13: 
188.             /*||(s->pict_type != AV_PICTURE_TYPE_I && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/
189.             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
190.             int size= buf_size + avctx->extradata_size;
                 ^
191.             *poutbuf_size= size;
192.             *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);

libavcodec/parser.c:191:13: 
189.             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
190.             int size= buf_size + avctx->extradata_size;
191.             *poutbuf_size= size;
                 ^
192.             *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
193. 

libavcodec/parser.c:192:13: 
190.             int size= buf_size + avctx->extradata_size;
191.             *poutbuf_size= size;
192.             *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
                 ^
193. 
194.             memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);

libavutil/mem.c:66:1: start of procedure av_malloc()
  64.  * linker will do it automatically. */
  65. 
  66. void *av_malloc(size_t size)
      ^
  67. {
  68.     void *ptr = NULL;

libavutil/mem.c:68:5: 
  66. void *av_malloc(size_t size)
  67. {
  68.     void *ptr = NULL;
          ^
  69. #if CONFIG_MEMALIGN_HACK
  70.     long diff;

libavutil/mem.c:74:9: Taking true branch
  72. 
  73.     /* let's disallow possible ambiguous cases */
  74.     if (size > (INT_MAX - 32) || !size)
              ^
  75.         return NULL;
  76. 

libavutil/mem.c:75:9: 
  73.     /* let's disallow possible ambiguous cases */
  74.     if (size > (INT_MAX - 32) || !size)
  75.         return NULL;
              ^
  76. 
  77. #if CONFIG_MEMALIGN_HACK

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

libavcodec/parser.c:194:13: 
192.             *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
193. 
194.             memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
                 ^
195.             memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
196.             return 1;

int av_parser_change(AVCodecParserContext *s,
                     AVCodecContext *avctx,
                     uint8_t **poutbuf, int *poutbuf_size,
                     const uint8_t *buf, int buf_size, int keyframe){
    if(s && s->parser->split){
        if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){
            int i= s->parser->split(avctx, buf, buf_size);
            buf += i;
            buf_size -= i;
        }
    }
    *poutbuf= (uint8_t *) buf;
    *poutbuf_size= buf_size;
    if(avctx->extradata){
        if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))
             ){
            int size= buf_size + avctx->extradata_size;
            *poutbuf_size= size;
            *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
            memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
            memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
            return 1;
        }
    }
    return 0;
}
['int av_parser_change(AVCodecParserContext *s,\n                     AVCodecContext *avctx,\n                     uint8_t **poutbuf, int *poutbuf_size,\n                     const uint8_t *buf, int buf_size, int keyframe){\n    if(s && s->parser->split){\n        if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){\n            int i= s->parser->split(avctx, buf, buf_size);\n            buf += i;\n            buf_size -= i;\n        }\n    }\n    *poutbuf= (uint8_t *) buf;\n    *poutbuf_size= buf_size;\n    if(avctx->extradata){\n        if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))\n             ){\n            int size= buf_size + avctx->extradata_size;\n            *poutbuf_size= size;\n            *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);\n            memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);\n            memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);\n            return 1;\n        }\n    }\n    return 0;\n}', 'void *av_malloc(size_t size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if (size > (INT_MAX - 32) || !size)\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size + 32);\n    if (!ptr)\n        return ptr;\n    diff              = ((-(long)ptr - 1) & 31) + 1;\n    ptr               = (char *)ptr + diff;\n    ((char *)ptr)[-1] = diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr, 32, size))\n        ptr = NULL;\n#elif HAVE_ALIGNED_MALLOC\n    ptr = _aligned_malloc(size, 32);\n#elif HAVE_MEMALIGN\n    ptr = memalign(32, size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']