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

libavcodec/dump_extradata_bsf.c:24:1: start of procedure dump_extradata()
22. 
23. 
24. static int dump_extradata(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
    ^
25.                      uint8_t **poutbuf, int *poutbuf_size,
26.                      const uint8_t *buf, int buf_size, int keyframe){

libavcodec/dump_extradata_bsf.c:27:14: Condition is true
25.                      uint8_t **poutbuf, int *poutbuf_size,
26.                      const uint8_t *buf, int buf_size, int keyframe){
27.     int cmd= args ? *args : 0;
                 ^
28.     /* cast to avoid warning about discarding qualifiers */
29.     if(avctx->extradata){

libavcodec/dump_extradata_bsf.c:27:5: 
25.                      uint8_t **poutbuf, int *poutbuf_size,
26.                      const uint8_t *buf, int buf_size, int keyframe){
27.     int cmd= args ? *args : 0;
        ^
28.     /* cast to avoid warning about discarding qualifiers */
29.     if(avctx->extradata){

libavcodec/dump_extradata_bsf.c:29:8: Taking true branch
27.     int cmd= args ? *args : 0;
28.     /* cast to avoid warning about discarding qualifiers */
29.     if(avctx->extradata){
           ^
30.         if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER) && cmd=='a')
31.            ||(keyframe && (cmd=='k' || !cmd))

libavcodec/dump_extradata_bsf.c:30:15: Taking false branch
28.     /* cast to avoid warning about discarding qualifiers */
29.     if(avctx->extradata){
30.         if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER) && cmd=='a')
                  ^
31.            ||(keyframe && (cmd=='k' || !cmd))
32.            ||(cmd=='e')

libavcodec/dump_extradata_bsf.c:31:15: Taking false branch
29.     if(avctx->extradata){
30.         if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER) && cmd=='a')
31.            ||(keyframe && (cmd=='k' || !cmd))
                  ^
32.            ||(cmd=='e')
33.             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){

libavcodec/dump_extradata_bsf.c:32:15: Taking true branch
30.         if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER) && cmd=='a')
31.            ||(keyframe && (cmd=='k' || !cmd))
32.            ||(cmd=='e')
                  ^
33.             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
34.             int size= buf_size + avctx->extradata_size;

libavcodec/dump_extradata_bsf.c:34:13: 
32.            ||(cmd=='e')
33.             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
34.             int size= buf_size + avctx->extradata_size;
                ^
35.             *poutbuf_size= size;
36.             *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);

libavcodec/dump_extradata_bsf.c:35:13: 
33.             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
34.             int size= buf_size + avctx->extradata_size;
35.             *poutbuf_size= size;
                ^
36.             *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
37. 

libavcodec/dump_extradata_bsf.c:36:13: 
34.             int size= buf_size + avctx->extradata_size;
35.             *poutbuf_size= size;
36.             *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
                ^
37. 
38.             memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);

libavutil/mem.c:47:1: start of procedure av_malloc()
  45.    linker will do it automatically. */
  46. 
  47. void *av_malloc(unsigned int size)
      ^
  48. {
  49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
  47. void *av_malloc(unsigned int size)
  48. {
  49.     void *ptr = NULL;
          ^
  50. #if CONFIG_MEMALIGN_HACK
  51.     long diff;

libavutil/mem.c:55:8: Taking true branch
  53. 
  54.     /* let's disallow possible ambiguous cases */
  55.     if(size > (INT_MAX-16) )
             ^
  56.         return NULL;
  57. 

libavutil/mem.c:56:9: 
  54.     /* let's disallow possible ambiguous cases */
  55.     if(size > (INT_MAX-16) )
  56.         return NULL;
              ^
  57. 
  58. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:99:1: return from a call to av_malloc
   97. #endif
   98.     return ptr;
   99. }
       ^
  100. 
  101. void *av_realloc(void *ptr, unsigned int size)

libavcodec/dump_extradata_bsf.c:38:13: 
36.             *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
37. 
38.             memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
                ^
39.             memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
40.             return 1;
