libavcodec/noise_bsf.c:33: error: Null Dereference
  pointer `*poutbuf` last assigned on line 31 could be null and is dereferenced by call to `memcpy()` at line 33, column 5.

libavcodec/noise_bsf.c:24:1: start of procedure noise()
22. 
23. 
24. static int noise(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/noise_bsf.c:27:5: 
25.                      uint8_t **poutbuf, int *poutbuf_size,
26.                      const uint8_t *buf, int buf_size, int keyframe){
27.     unsigned int *state= bsfc->priv_data;
        ^
28.     int amount= args ? atoi(args) : (*state % 10001+1);
29.     int i;

libavcodec/noise_bsf.c:28:17: Condition is false
26.                      const uint8_t *buf, int buf_size, int keyframe){
27.     unsigned int *state= bsfc->priv_data;
28.     int amount= args ? atoi(args) : (*state % 10001+1);
                    ^
29.     int i;
30. 

libavcodec/noise_bsf.c:28:5: 
26.                      const uint8_t *buf, int buf_size, int keyframe){
27.     unsigned int *state= bsfc->priv_data;
28.     int amount= args ? atoi(args) : (*state % 10001+1);
        ^
29.     int i;
30. 

libavcodec/noise_bsf.c:31:5: 
29.     int i;
30. 
31.     *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
        ^
32. 
33.     memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);

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

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

libavutil/mem.c:72:8: Taking true branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-16) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:73:9: 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-16) )
  73.         return NULL;
              ^
  74. 
  75. #if CONFIG_MEMALIGN_HACK

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

libavcodec/noise_bsf.c:33:5: 
31.     *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
32. 
33.     memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
        ^
34.     for(i=0; i<buf_size; i++){
35.         (*state) += (*poutbuf)[i] + 1;

static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
                     uint8_t **poutbuf, int *poutbuf_size,
                     const uint8_t *buf, int buf_size, int keyframe){
    unsigned int *state= bsfc->priv_data;
    int amount= args ? atoi(args) : (*state % 10001+1);
    int i;
    *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
    memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
    for(i=0; i<buf_size; i++){
        (*state) += (*poutbuf)[i] + 1;
        if(*state % amount == 0)
            (*poutbuf)[i] = *state;
    }
    return 1;
}
['static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,\n                     uint8_t **poutbuf, int *poutbuf_size,\n                     const uint8_t *buf, int buf_size, int keyframe){\n    unsigned int *state= bsfc->priv_data;\n    int amount= args ? atoi(args) : (*state % 10001+1);\n    int i;\n    *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);\n    memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);\n    for(i=0; i<buf_size; i++){\n        (*state) += (*poutbuf)[i] + 1;\n        if(*state % amount == 0)\n            (*poutbuf)[i] = *state;\n    }\n    return 1;\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-16) )\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+16);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&15) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr,16,size))\n        ptr = NULL;\n#elif HAVE_MEMALIGN\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']