libavcodec/mp3_header_compress_bsf.c:51: error: Null Dereference
  pointer `avctx->extradata` last assigned on line 50 could be null and is dereferenced by call to `strcpy()` at line 51, column 9.

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

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

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

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

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

libavcodec/mpegaudio.h:147:1: start of procedure ff_mpa_check_header()
  145. 
  146. /* fast header check for resync */
  147. static inline int ff_mpa_check_header(uint32_t header){
       ^
  148.     /* header */
  149.     if ((header & 0xffe00000) != 0xffe00000)

libavcodec/mpegaudio.h:149:9: Taking false branch
  147. static inline int ff_mpa_check_header(uint32_t header){
  148.     /* header */
  149.     if ((header & 0xffe00000) != 0xffe00000)
               ^
  150.         return -1;
  151.     /* layer check */

libavcodec/mpegaudio.h:152:9: Taking false branch
  150.         return -1;
  151.     /* layer check */
  152.     if ((header & (3<<17)) == 0)
               ^
  153.         return -1;
  154.     /* bit rate */

libavcodec/mpegaudio.h:155:9: Taking false branch
  153.         return -1;
  154.     /* bit rate */
  155.     if ((header & (0xf<<12)) == 0xf<<12)
               ^
  156.         return -1;
  157.     /* frequency */

libavcodec/mpegaudio.h:158:9: Taking false branch
  156.         return -1;
  157.     /* frequency */
  158.     if ((header & (3<<10)) == 3<<10)
               ^
  159.         return -1;
  160.     return 0;

libavcodec/mpegaudio.h:160:5: 
  158.     if ((header & (3<<10)) == 3<<10)
  159.         return -1;
  160.     return 0;
           ^
  161. }
  162. 

libavcodec/mpegaudio.h:161:1: return from a call to ff_mpa_check_header
  159.         return -1;
  160.     return 0;
  161. }
       ^
  162. 
  163. #endif /* AVCODEC_MPEGAUDIO_H */

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

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

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

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

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

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 false branch
  53. 
  54.     /* let's disallow possible ambiguous cases */
  55.     if(size > (INT_MAX-16) )
             ^
  56.         return NULL;
  57. 

libavutil/mem.c:66:9: Taking true branch
  64.     ((char*)ptr)[-1]= diff;
  65. #elif HAVE_POSIX_MEMALIGN
  66.     if (posix_memalign(&ptr,16,size))
              ^
  67.         ptr = NULL;
  68. #elif HAVE_MEMALIGN

libavutil/mem.c:67:9: 
  65. #elif HAVE_POSIX_MEMALIGN
  66.     if (posix_memalign(&ptr,16,size))
  67.         ptr = NULL;
              ^
  68. #elif HAVE_MEMALIGN
  69.     ptr = memalign(16,size);

libavutil/mem.c:99:5: 
   97.     ptr = malloc(size);
   98. #endif
   99.     return ptr;
           ^
  100. }
  101. 

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

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