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

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

libavcodec/mp3_header_compress_bsf.c:32:8: Taking false branch
30.     int mode_extension, header_size;
31. 
32.     if(avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){
           ^
33.         av_log(avctx, AV_LOG_ERROR, "not standards compliant\n");
34.         return -1;

libavcodec/mp3_header_compress_bsf.c:37:5: 
35.     }
36. 
37.     header = AV_RB32(buf);
        ^
38.     mode_extension= (header>>4)&3;
39. 

libavutil/bswap.h:66:1: start of procedure av_bswap32()
  64. 
  65. #ifndef av_bswap32
  66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
      ^
  67. {
  68.     return AV_BSWAP32C(x);

libavutil/bswap.h:68:5: 
  66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
  67. {
  68.     return AV_BSWAP32C(x);
          ^
  69. }
  70. #endif

libavutil/bswap.h:69:1: return from a call to av_bswap32
  67. {
  68.     return AV_BSWAP32C(x);
  69. }
      ^
  70. #endif
  71. 

libavcodec/mp3_header_compress_bsf.c:38:5: 
36. 
37.     header = AV_RB32(buf);
38.     mode_extension= (header>>4)&3;
        ^
39. 
40.     if(ff_mpa_check_header(header) < 0 || (header&0x60000) != 0x20000){

libavcodec/mp3_header_compress_bsf.c:40:8: 
38.     mode_extension= (header>>4)&3;
39. 
40.     if(ff_mpa_check_header(header) < 0 || (header&0x60000) != 0x20000){
           ^
41. output_unchanged:
42.         *poutbuf= (uint8_t *) buf;

libavcodec/mpegaudiodecheader.h:60:1: start of procedure ff_mpa_check_header()
  58. 
  59. /* fast header check for resync */
  60. static inline int ff_mpa_check_header(uint32_t header){
      ^
  61.     /* header */
  62.     if ((header & 0xffe00000) != 0xffe00000)

libavcodec/mpegaudiodecheader.h:62:9: Taking false branch
  60. static inline int ff_mpa_check_header(uint32_t header){
  61.     /* header */
  62.     if ((header & 0xffe00000) != 0xffe00000)
              ^
  63.         return -1;
  64.     /* layer check */

libavcodec/mpegaudiodecheader.h:65:9: Taking false branch
  63.         return -1;
  64.     /* layer check */
  65.     if ((header & (3<<17)) == 0)
              ^
  66.         return -1;
  67.     /* bit rate */

libavcodec/mpegaudiodecheader.h:68:9: Taking false branch
  66.         return -1;
  67.     /* bit rate */
  68.     if ((header & (0xf<<12)) == 0xf<<12)
              ^
  69.         return -1;
  70.     /* frequency */

libavcodec/mpegaudiodecheader.h:71:9: Taking false branch
  69.         return -1;
  70.     /* frequency */
  71.     if ((header & (3<<10)) == 3<<10)
              ^
  72.         return -1;
  73.     return 0;

libavcodec/mpegaudiodecheader.h:73:5: 
  71.     if ((header & (3<<10)) == 3<<10)
  72.         return -1;
  73.     return 0;
          ^
  74. }
  75. 

libavcodec/mpegaudiodecheader.h:74:1: return from a call to ff_mpa_check_header
  72.         return -1;
  73.     return 0;
  74. }
      ^
  75. 
  76. #endif /* AVCODEC_MPEGAUDIODECHEADER_H */

libavcodec/mp3_header_compress_bsf.c:40:8: Taking false branch
38.     mode_extension= (header>>4)&3;
39. 
40.     if(ff_mpa_check_header(header) < 0 || (header&0x60000) != 0x20000){
           ^
41. output_unchanged:
42.         *poutbuf= (uint8_t *) buf;

libavcodec/mp3_header_compress_bsf.c:40:43: Taking false branch
38.     mode_extension= (header>>4)&3;
39. 
40.     if(ff_mpa_check_header(header) < 0 || (header&0x60000) != 0x20000){
                                              ^
41. output_unchanged:
42.         *poutbuf= (uint8_t *) buf;

libavcodec/mp3_header_compress_bsf.c:49:8: Taking true branch
47.     }
48. 
49.     if(avctx->extradata_size == 0){
           ^
50.         avctx->extradata_size=15;
51.         avctx->extradata= av_malloc(avctx->extradata_size);

libavcodec/mp3_header_compress_bsf.c:50:9: 
48. 
49.     if(avctx->extradata_size == 0){
50.         avctx->extradata_size=15;
            ^
51.         avctx->extradata= av_malloc(avctx->extradata_size);
52.         strcpy(avctx->extradata, "FFCMP3 0.0");

libavcodec/mp3_header_compress_bsf.c:51:9: 
49.     if(avctx->extradata_size == 0){
50.         avctx->extradata_size=15;
51.         avctx->extradata= av_malloc(avctx->extradata_size);
            ^
52.         strcpy(avctx->extradata, "FFCMP3 0.0");
53.         memcpy(avctx->extradata+11, buf, 4);

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:71:5: 
  69. #endif
  70. 
  71.     assert(size);
          ^
  72. 
  73.     /* let's disallow possible ambiguous cases */

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

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

libavutil/mem.c:85:9: Taking false branch
  83.     ((char*)ptr)[-1]= diff;
  84. #elif HAVE_POSIX_MEMALIGN
  85.     if (posix_memalign(&ptr,32,size))
              ^
  86.         ptr = NULL;
  87. #elif HAVE_MEMALIGN

libavutil/mem.c:116:5: 
  114.     ptr = malloc(size);
  115. #endif
  116.     return ptr;
           ^
  117. }
  118. 

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/mp3_header_compress_bsf.c:52:9: 
50.         avctx->extradata_size=15;
51.         avctx->extradata= av_malloc(avctx->extradata_size);
52.         strcpy(avctx->extradata, "FFCMP3 0.0");
            ^
53.         memcpy(avctx->extradata+11, buf, 4);
54.     }

libavcodec/mp3_header_compress_bsf.c:53:9: 
51.         avctx->extradata= av_malloc(avctx->extradata_size);
52.         strcpy(avctx->extradata, "FFCMP3 0.0");
53.         memcpy(avctx->extradata+11, buf, 4);
            ^
54.     }
55.     if(avctx->extradata_size != 15){

libavcodec/mp3_header_compress_bsf.c:55:8: Taking false branch
53.         memcpy(avctx->extradata+11, buf, 4);
54.     }
55.     if(avctx->extradata_size != 15){
           ^
56.         av_log(avctx, AV_LOG_ERROR, "Extradata invalid\n");
57.         return -1;

libavcodec/mp3_header_compress_bsf.c:59:5: 
57.         return -1;
58.     }
59.     extraheader = AV_RB32(avctx->extradata+11);
        ^
60.     if((extraheader&MP3_MASK) != (header&MP3_MASK))
61.         goto output_unchanged;

libavutil/bswap.h:66:1: start of procedure av_bswap32()
  64. 
  65. #ifndef av_bswap32
  66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
      ^
  67. {
  68.     return AV_BSWAP32C(x);

libavutil/bswap.h:68:5: 
  66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
  67. {
  68.     return AV_BSWAP32C(x);
          ^
  69. }
  70. #endif

libavutil/bswap.h:69:1: return from a call to av_bswap32
  67. {
  68.     return AV_BSWAP32C(x);
  69. }
      ^
  70. #endif
  71. 

libavcodec/mp3_header_compress_bsf.c:60:8: Taking false branch
58.     }
59.     extraheader = AV_RB32(avctx->extradata+11);
60.     if((extraheader&MP3_MASK) != (header&MP3_MASK))
           ^
61.         goto output_unchanged;
62. 

libavcodec/mp3_header_compress_bsf.c:63:19: Condition is false
61.         goto output_unchanged;
62. 
63.     header_size= (header&0x10000) ? 4 : 6;
                      ^
64. 
65.     *poutbuf_size= buf_size - header_size;

libavcodec/mp3_header_compress_bsf.c:63:18: 
61.         goto output_unchanged;
62. 
63.     header_size= (header&0x10000) ? 4 : 6;
                     ^
64. 
65.     *poutbuf_size= buf_size - header_size;

libavcodec/mp3_header_compress_bsf.c:63:5: 
61.         goto output_unchanged;
62. 
63.     header_size= (header&0x10000) ? 4 : 6;
        ^
64. 
65.     *poutbuf_size= buf_size - header_size;

libavcodec/mp3_header_compress_bsf.c:65:5: 
63.     header_size= (header&0x10000) ? 4 : 6;
64. 
65.     *poutbuf_size= buf_size - header_size;
        ^
66.     *poutbuf= av_malloc(buf_size - header_size + FF_INPUT_BUFFER_PADDING_SIZE);
67.     memcpy(*poutbuf, buf + header_size, buf_size - header_size + FF_INPUT_BUFFER_PADDING_SIZE);

libavcodec/mp3_header_compress_bsf.c:66:5: 
64. 
65.     *poutbuf_size= buf_size - header_size;
66.     *poutbuf= av_malloc(buf_size - header_size + FF_INPUT_BUFFER_PADDING_SIZE);
        ^
67.     memcpy(*poutbuf, buf + header_size, buf_size - header_size + FF_INPUT_BUFFER_PADDING_SIZE);
68. 

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:71:5: 
  69. #endif
  70. 
  71.     assert(size);
          ^
  72. 
  73.     /* let's disallow possible ambiguous cases */

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: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/mp3_header_compress_bsf.c:67:5: 
65.     *poutbuf_size= buf_size - header_size;
66.     *poutbuf= av_malloc(buf_size - header_size + FF_INPUT_BUFFER_PADDING_SIZE);
67.     memcpy(*poutbuf, buf + header_size, buf_size - header_size + FF_INPUT_BUFFER_PADDING_SIZE);
        ^
68. 
69.     if(avctx->channels==2){
