libavcodec/sonic.c:809: error: Null Dereference
  pointer `s->tap_quant` last assigned on line 807 could be null and is dereferenced at line 809, column 9.

libavcodec/sonic.c:751:1: start of procedure sonic_decode_init()
749.     { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 };
750. 
751. static av_cold int sonic_decode_init(AVCodecContext *avctx)
     ^
752. {
753.     SonicContext *s = avctx->priv_data;

libavcodec/sonic.c:753:5: 
751. static av_cold int sonic_decode_init(AVCodecContext *avctx)
752. {
753.     SonicContext *s = avctx->priv_data;
         ^
754.     GetBitContext gb;
755.     int i, version;

libavcodec/sonic.c:757:5: 
755.     int i, version;
756. 
757.     s->channels = avctx->channels;
         ^
758.     s->samplerate = avctx->sample_rate;
759. 

libavcodec/sonic.c:758:5: 
756. 
757.     s->channels = avctx->channels;
758.     s->samplerate = avctx->sample_rate;
         ^
759. 
760.     if (!avctx->extradata)

libavcodec/sonic.c:760:10: Taking false branch
758.     s->samplerate = avctx->sample_rate;
759. 
760.     if (!avctx->extradata)
              ^
761.     {
762.         av_log(avctx, AV_LOG_ERROR, "No mandatory headers present\n");

libavcodec/sonic.c:766:5: 
764.     }
765. 
766.     init_get_bits(&gb, avctx->extradata, avctx->extradata_size);
         ^
767. 
768.     version = get_bits(&gb, 2);

libavcodec/get_bits.h:391:1: start of procedure init_get_bits()
  389.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  390.  */
  391. static inline void init_get_bits(GetBitContext *s,
       ^
  392.                    const uint8_t *buffer, int bit_size)
  393. {

libavcodec/get_bits.h:394:5: 
  392.                    const uint8_t *buffer, int bit_size)
  393. {
  394.     int buffer_size = (bit_size+7)>>3;
           ^
  395.     if (buffer_size < 0 || bit_size < 0) {
  396.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:395:9: Taking false branch
  393. {
  394.     int buffer_size = (bit_size+7)>>3;
  395.     if (buffer_size < 0 || bit_size < 0) {
               ^
  396.         buffer_size = bit_size = 0;
  397.         buffer = NULL;

libavcodec/get_bits.h:395:28: Taking false branch
  393. {
  394.     int buffer_size = (bit_size+7)>>3;
  395.     if (buffer_size < 0 || bit_size < 0) {
                                  ^
  396.         buffer_size = bit_size = 0;
  397.         buffer = NULL;

libavcodec/get_bits.h:400:5: 
  398.     }
  399. 
  400.     s->buffer       = buffer;
           ^
  401.     s->size_in_bits = bit_size;
  402.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:401:5: 
  399. 
  400.     s->buffer       = buffer;
  401.     s->size_in_bits = bit_size;
           ^
  402.     s->buffer_end   = buffer + buffer_size;
  403. #ifdef ALT_BITSTREAM_READER

libavcodec/get_bits.h:402:5: 
  400.     s->buffer       = buffer;
  401.     s->size_in_bits = bit_size;
  402.     s->buffer_end   = buffer + buffer_size;
           ^
  403. #ifdef ALT_BITSTREAM_READER
  404.     s->index        = 0;

libavcodec/get_bits.h:404:5: 
  402.     s->buffer_end   = buffer + buffer_size;
  403. #ifdef ALT_BITSTREAM_READER
  404.     s->index        = 0;
           ^
  405. #elif defined A32_BITSTREAM_READER
  406.     s->buffer_ptr   = (uint32_t*)((intptr_t)buffer & ~3);

libavcodec/get_bits.h:410:1: return from a call to init_get_bits
  408.     skip_bits_long(s, 0);
  409. #endif
  410. }
       ^
  411. 
  412. static inline void align_get_bits(GetBitContext *s)

libavcodec/sonic.c:768:5: 
766.     init_get_bits(&gb, avctx->extradata, avctx->extradata_size);
767. 
768.     version = get_bits(&gb, 2);
         ^
769.     if (version > 1)
770.     {

libavcodec/get_bits.h:282:1: start of procedure get_bits()
  280.  * Read 1-25 bits.
  281.  */
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  283.     register int tmp;
  284.     OPEN_READER(re, s);

libavcodec/get_bits.h:284:5: 
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
  283.     register int tmp;
  284.     OPEN_READER(re, s);
           ^
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:285:5: 
  283.     register int tmp;
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
           ^
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);

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.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
    66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
            ^
    69.     x= (x>>16) | (x<<16);
    70.     return x;

libavutil/bswap.h:69:5: 
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
            ^
    70.     return x;
    71. }

libavutil/bswap.h:70:5: 
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
    70.     return x;
            ^
    71. }
    72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
    69.     x= (x>>16) | (x<<16);
    70.     return x;
    71. }
        ^
    72. #endif
    73. 

libavcodec/get_bits.h:286:5: 
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
           ^
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);

libavcodec/get_bits.h:287:5: 
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
           ^
  288.     CLOSE_READER(re, s);
  289.     return tmp;

libavcodec/get_bits.h:288:5: 
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
           ^
  289.     return tmp;
  290. }

libavcodec/get_bits.h:289:5: 
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
  289.     return tmp;
           ^
  290. }
  291. 

libavcodec/get_bits.h:290:1: return from a call to get_bits
  288.     CLOSE_READER(re, s);
  289.     return tmp;
  290. }
       ^
  291. 
  292. /**

libavcodec/sonic.c:769:9: Taking false branch
767. 
768.     version = get_bits(&gb, 2);
769.     if (version > 1)
             ^
770.     {
771.         av_log(avctx, AV_LOG_ERROR, "Unsupported Sonic version, please report\n");

libavcodec/sonic.c:775:9: Taking true branch
773.     }
774. 
775.     if (version == 1)
             ^
776.     {
777.         s->channels = get_bits(&gb, 2);

libavcodec/sonic.c:777:9: 
775.     if (version == 1)
776.     {
777.         s->channels = get_bits(&gb, 2);
             ^
778.         s->samplerate = samplerate_table[get_bits(&gb, 4)];
779.         av_log(avctx, AV_LOG_INFO, "Sonicv2 chans: %d samprate: %d\n",

libavcodec/get_bits.h:282:1: start of procedure get_bits()
  280.  * Read 1-25 bits.
  281.  */
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  283.     register int tmp;
  284.     OPEN_READER(re, s);

libavcodec/get_bits.h:284:5: 
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
  283.     register int tmp;
  284.     OPEN_READER(re, s);
           ^
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:285:5: 
  283.     register int tmp;
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
           ^
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);

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.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
    66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
            ^
    69.     x= (x>>16) | (x<<16);
    70.     return x;

libavutil/bswap.h:69:5: 
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
            ^
    70.     return x;
    71. }

libavutil/bswap.h:70:5: 
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
    70.     return x;
            ^
    71. }
    72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
    69.     x= (x>>16) | (x<<16);
    70.     return x;
    71. }
        ^
    72. #endif
    73. 

libavcodec/get_bits.h:286:5: 
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
           ^
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);

libavcodec/get_bits.h:287:5: 
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
           ^
  288.     CLOSE_READER(re, s);
  289.     return tmp;

libavcodec/get_bits.h:288:5: 
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
           ^
  289.     return tmp;
  290. }

libavcodec/get_bits.h:289:5: 
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
  289.     return tmp;
           ^
  290. }
  291. 

libavcodec/get_bits.h:290:1: return from a call to get_bits
  288.     CLOSE_READER(re, s);
  289.     return tmp;
  290. }
       ^
  291. 
  292. /**

libavcodec/sonic.c:778:9: 
776.     {
777.         s->channels = get_bits(&gb, 2);
778.         s->samplerate = samplerate_table[get_bits(&gb, 4)];
             ^
779.         av_log(avctx, AV_LOG_INFO, "Sonicv2 chans: %d samprate: %d\n",
780.             s->channels, s->samplerate);

libavcodec/get_bits.h:282:1: start of procedure get_bits()
  280.  * Read 1-25 bits.
  281.  */
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  283.     register int tmp;
  284.     OPEN_READER(re, s);

libavcodec/get_bits.h:284:5: 
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
  283.     register int tmp;
  284.     OPEN_READER(re, s);
           ^
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:285:5: 
  283.     register int tmp;
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
           ^
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);

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.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
    66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
            ^
    69.     x= (x>>16) | (x<<16);
    70.     return x;

libavutil/bswap.h:69:5: 
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
            ^
    70.     return x;
    71. }

libavutil/bswap.h:70:5: 
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
    70.     return x;
            ^
    71. }
    72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
    69.     x= (x>>16) | (x<<16);
    70.     return x;
    71. }
        ^
    72. #endif
    73. 

libavcodec/get_bits.h:286:5: 
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
           ^
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);

libavcodec/get_bits.h:287:5: 
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
           ^
  288.     CLOSE_READER(re, s);
  289.     return tmp;

libavcodec/get_bits.h:288:5: 
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
           ^
  289.     return tmp;
  290. }

libavcodec/get_bits.h:289:5: 
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
  289.     return tmp;
           ^
  290. }
  291. 

libavcodec/get_bits.h:290:1: return from a call to get_bits
  288.     CLOSE_READER(re, s);
  289.     return tmp;
  290. }
       ^
  291. 
  292. /**

libavcodec/sonic.c:779:9: Skipping av_log(): empty list of specs
777.         s->channels = get_bits(&gb, 2);
778.         s->samplerate = samplerate_table[get_bits(&gb, 4)];
779.         av_log(avctx, AV_LOG_INFO, "Sonicv2 chans: %d samprate: %d\n",
             ^
780.             s->channels, s->samplerate);
781.     }

libavcodec/sonic.c:783:9: Taking false branch
781.     }
782. 
783.     if (s->channels > MAX_CHANNELS)
             ^
784.     {
785.         av_log(avctx, AV_LOG_ERROR, "Only mono and stereo streams are supported by now\n");

libavcodec/sonic.c:789:5: 
787.     }
788. 
789.     s->lossless = get_bits1(&gb);
         ^
790.     if (!s->lossless)
791.         skip_bits(&gb, 3); // XXX FIXME

libavcodec/get_bits.h:311:1: start of procedure get_bits1()
  309. }
  310. 
  311. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  312. #ifdef ALT_BITSTREAM_READER
  313.     unsigned int index = s->index;

libavcodec/get_bits.h:313:5: 
  311. static inline unsigned int get_bits1(GetBitContext *s){
  312. #ifdef ALT_BITSTREAM_READER
  313.     unsigned int index = s->index;
           ^
  314.     uint8_t result = s->buffer[index>>3];
  315. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:314:5: 
  312. #ifdef ALT_BITSTREAM_READER
  313.     unsigned int index = s->index;
  314.     uint8_t result = s->buffer[index>>3];
           ^
  315. #ifdef ALT_BITSTREAM_READER_LE
  316.     result >>= index & 7;

libavcodec/get_bits.h:316:5: 
  314.     uint8_t result = s->buffer[index>>3];
  315. #ifdef ALT_BITSTREAM_READER_LE
  316.     result >>= index & 7;
           ^
  317.     result &= 1;
  318. #else

libavcodec/get_bits.h:317:5: 
  315. #ifdef ALT_BITSTREAM_READER_LE
  316.     result >>= index & 7;
  317.     result &= 1;
           ^
  318. #else
  319.     result <<= index & 7;

libavcodec/get_bits.h:322:5: 
  320.     result >>= 8 - 1;
  321. #endif
  322.     index++;
           ^
  323.     s->index = index;
  324. 

libavcodec/get_bits.h:323:5: 
  321. #endif
  322.     index++;
  323.     s->index = index;
           ^
  324. 
  325.     return result;

libavcodec/get_bits.h:325:5: 
  323.     s->index = index;
  324. 
  325.     return result;
           ^
  326. #else
  327.     return get_bits(s, 1);

libavcodec/get_bits.h:329:1: return from a call to get_bits1
  327.     return get_bits(s, 1);
  328. #endif
  329. }
       ^
  330. 
  331. static inline unsigned int show_bits1(GetBitContext *s){

libavcodec/sonic.c:790:10: Taking false branch
788. 
789.     s->lossless = get_bits1(&gb);
790.     if (!s->lossless)
              ^
791.         skip_bits(&gb, 3); // XXX FIXME
792.     s->decorrelation = get_bits(&gb, 2);

libavcodec/sonic.c:792:5: 
790.     if (!s->lossless)
791.         skip_bits(&gb, 3); // XXX FIXME
792.     s->decorrelation = get_bits(&gb, 2);
         ^
793. 
794.     s->downsampling = get_bits(&gb, 2);

libavcodec/get_bits.h:282:1: start of procedure get_bits()
  280.  * Read 1-25 bits.
  281.  */
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  283.     register int tmp;
  284.     OPEN_READER(re, s);

libavcodec/get_bits.h:284:5: 
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
  283.     register int tmp;
  284.     OPEN_READER(re, s);
           ^
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:285:5: 
  283.     register int tmp;
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
           ^
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);

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.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
    66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
            ^
    69.     x= (x>>16) | (x<<16);
    70.     return x;

libavutil/bswap.h:69:5: 
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
            ^
    70.     return x;
    71. }

libavutil/bswap.h:70:5: 
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
    70.     return x;
            ^
    71. }
    72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
    69.     x= (x>>16) | (x<<16);
    70.     return x;
    71. }
        ^
    72. #endif
    73. 

libavcodec/get_bits.h:286:5: 
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
           ^
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);

libavcodec/get_bits.h:287:5: 
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
           ^
  288.     CLOSE_READER(re, s);
  289.     return tmp;

libavcodec/get_bits.h:288:5: 
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
           ^
  289.     return tmp;
  290. }

libavcodec/get_bits.h:289:5: 
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
  289.     return tmp;
           ^
  290. }
  291. 

libavcodec/get_bits.h:290:1: return from a call to get_bits
  288.     CLOSE_READER(re, s);
  289.     return tmp;
  290. }
       ^
  291. 
  292. /**

libavcodec/sonic.c:794:5: 
792.     s->decorrelation = get_bits(&gb, 2);
793. 
794.     s->downsampling = get_bits(&gb, 2);
         ^
795.     s->num_taps = (get_bits(&gb, 5)+1)<<5;
796.     if (get_bits1(&gb)) // XXX FIXME

libavcodec/get_bits.h:282:1: start of procedure get_bits()
  280.  * Read 1-25 bits.
  281.  */
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  283.     register int tmp;
  284.     OPEN_READER(re, s);

libavcodec/get_bits.h:284:5: 
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
  283.     register int tmp;
  284.     OPEN_READER(re, s);
           ^
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:285:5: 
  283.     register int tmp;
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
           ^
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);

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.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
    66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
            ^
    69.     x= (x>>16) | (x<<16);
    70.     return x;

libavutil/bswap.h:69:5: 
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
            ^
    70.     return x;
    71. }

libavutil/bswap.h:70:5: 
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
    70.     return x;
            ^
    71. }
    72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
    69.     x= (x>>16) | (x<<16);
    70.     return x;
    71. }
        ^
    72. #endif
    73. 

libavcodec/get_bits.h:286:5: 
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
           ^
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);

libavcodec/get_bits.h:287:5: 
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
           ^
  288.     CLOSE_READER(re, s);
  289.     return tmp;

libavcodec/get_bits.h:288:5: 
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
           ^
  289.     return tmp;
  290. }

libavcodec/get_bits.h:289:5: 
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
  289.     return tmp;
           ^
  290. }
  291. 

libavcodec/get_bits.h:290:1: return from a call to get_bits
  288.     CLOSE_READER(re, s);
  289.     return tmp;
  290. }
       ^
  291. 
  292. /**

libavcodec/sonic.c:795:5: 
793. 
794.     s->downsampling = get_bits(&gb, 2);
795.     s->num_taps = (get_bits(&gb, 5)+1)<<5;
         ^
796.     if (get_bits1(&gb)) // XXX FIXME
797.         av_log(avctx, AV_LOG_INFO, "Custom quant table\n");

libavcodec/get_bits.h:282:1: start of procedure get_bits()
  280.  * Read 1-25 bits.
  281.  */
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  283.     register int tmp;
  284.     OPEN_READER(re, s);

libavcodec/get_bits.h:284:5: 
  282. static inline unsigned int get_bits(GetBitContext *s, int n){
  283.     register int tmp;
  284.     OPEN_READER(re, s);
           ^
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:285:5: 
  283.     register int tmp;
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
           ^
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);

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.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
    66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
            ^
    69.     x= (x>>16) | (x<<16);
    70.     return x;

libavutil/bswap.h:69:5: 
    67. {
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
            ^
    70.     return x;
    71. }

libavutil/bswap.h:70:5: 
    68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
    69.     x= (x>>16) | (x<<16);
    70.     return x;
            ^
    71. }
    72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
    69.     x= (x>>16) | (x<<16);
    70.     return x;
    71. }
        ^
    72. #endif
    73. 

libavcodec/get_bits.h:286:5: 
  284.     OPEN_READER(re, s);
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
           ^
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);

libavcodec/get_bits.h:287:5: 
  285.     UPDATE_CACHE(re, s);
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
           ^
  288.     CLOSE_READER(re, s);
  289.     return tmp;

libavcodec/get_bits.h:288:5: 
  286.     tmp = SHOW_UBITS(re, s, n);
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
           ^
  289.     return tmp;
  290. }

libavcodec/get_bits.h:289:5: 
  287.     LAST_SKIP_BITS(re, s, n);
  288.     CLOSE_READER(re, s);
  289.     return tmp;
           ^
  290. }
  291. 

libavcodec/get_bits.h:290:1: return from a call to get_bits
  288.     CLOSE_READER(re, s);
  289.     return tmp;
  290. }
       ^
  291. 
  292. /**

libavcodec/sonic.c:796:9: 
794.     s->downsampling = get_bits(&gb, 2);
795.     s->num_taps = (get_bits(&gb, 5)+1)<<5;
796.     if (get_bits1(&gb)) // XXX FIXME
             ^
797.         av_log(avctx, AV_LOG_INFO, "Custom quant table\n");
798. 

libavcodec/get_bits.h:311:1: start of procedure get_bits1()
  309. }
  310. 
  311. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  312. #ifdef ALT_BITSTREAM_READER
  313.     unsigned int index = s->index;

libavcodec/get_bits.h:313:5: 
  311. static inline unsigned int get_bits1(GetBitContext *s){
  312. #ifdef ALT_BITSTREAM_READER
  313.     unsigned int index = s->index;
           ^
  314.     uint8_t result = s->buffer[index>>3];
  315. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:314:5: 
  312. #ifdef ALT_BITSTREAM_READER
  313.     unsigned int index = s->index;
  314.     uint8_t result = s->buffer[index>>3];
           ^
  315. #ifdef ALT_BITSTREAM_READER_LE
  316.     result >>= index & 7;

libavcodec/get_bits.h:316:5: 
  314.     uint8_t result = s->buffer[index>>3];
  315. #ifdef ALT_BITSTREAM_READER_LE
  316.     result >>= index & 7;
           ^
  317.     result &= 1;
  318. #else

libavcodec/get_bits.h:317:5: 
  315. #ifdef ALT_BITSTREAM_READER_LE
  316.     result >>= index & 7;
  317.     result &= 1;
           ^
  318. #else
  319.     result <<= index & 7;

libavcodec/get_bits.h:322:5: 
  320.     result >>= 8 - 1;
  321. #endif
  322.     index++;
           ^
  323.     s->index = index;
  324. 

libavcodec/get_bits.h:323:5: 
  321. #endif
  322.     index++;
  323.     s->index = index;
           ^
  324. 
  325.     return result;

libavcodec/get_bits.h:325:5: 
  323.     s->index = index;
  324. 
  325.     return result;
           ^
  326. #else
  327.     return get_bits(s, 1);

libavcodec/get_bits.h:329:1: return from a call to get_bits1
  327.     return get_bits(s, 1);
  328. #endif
  329. }
       ^
  330. 
  331. static inline unsigned int show_bits1(GetBitContext *s){

libavcodec/sonic.c:796:9: Taking true branch
794.     s->downsampling = get_bits(&gb, 2);
795.     s->num_taps = (get_bits(&gb, 5)+1)<<5;
796.     if (get_bits1(&gb)) // XXX FIXME
             ^
797.         av_log(avctx, AV_LOG_INFO, "Custom quant table\n");
798. 

libavcodec/sonic.c:797:9: Skipping av_log(): empty list of specs
795.     s->num_taps = (get_bits(&gb, 5)+1)<<5;
796.     if (get_bits1(&gb)) // XXX FIXME
797.         av_log(avctx, AV_LOG_INFO, "Custom quant table\n");
             ^
798. 
799.     s->block_align = (int)(2048.0*(s->samplerate/44100))/s->downsampling;

libavcodec/sonic.c:799:5: 
797.         av_log(avctx, AV_LOG_INFO, "Custom quant table\n");
798. 
799.     s->block_align = (int)(2048.0*(s->samplerate/44100))/s->downsampling;
         ^
800.     s->frame_size = s->channels*s->block_align*s->downsampling;
801. //    avctx->frame_size = s->block_align;

libavcodec/sonic.c:800:5: 
798. 
799.     s->block_align = (int)(2048.0*(s->samplerate/44100))/s->downsampling;
800.     s->frame_size = s->channels*s->block_align*s->downsampling;
         ^
801. //    avctx->frame_size = s->block_align;
802. 

libavcodec/sonic.c:803:5: Skipping av_log(): empty list of specs
801. //    avctx->frame_size = s->block_align;
802. 
803.     av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n",
         ^
804.         version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);
805. 

libavcodec/sonic.c:807:5: 
805. 
806.     // generate taps
807.     s->tap_quant = av_mallocz(4* s->num_taps);
         ^
808.     for (i = 0; i < s->num_taps; i++)
809.         s->tap_quant[i] = (int)(sqrt(i+1));

libavutil/mem.c:157:1: start of procedure av_mallocz()
  155. }
  156. 
  157. void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
       ^
  158. {
  159.     void *ptr = av_malloc(size);

libavutil/mem.c:159:5: 
  157. void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
  158. {
  159.     void *ptr = av_malloc(size);
           ^
  160.     if (ptr)
  161.         memset(ptr, 0, size);

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

libavutil/mem.c:66:5: 
    64. void *av_malloc(FF_INTERNAL_MEM_TYPE 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, FF_INTERNAL_MEM_TYPE size)

libavutil/mem.c:160:9: Taking false branch
  158. {
  159.     void *ptr = av_malloc(size);
  160.     if (ptr)
               ^
  161.         memset(ptr, 0, size);
  162.     return ptr;

libavutil/mem.c:162:5: 
  160.     if (ptr)
  161.         memset(ptr, 0, size);
  162.     return ptr;
           ^
  163. }
  164. 

libavutil/mem.c:163:1: return from a call to av_mallocz
  161.         memset(ptr, 0, size);
  162.     return ptr;
  163. }
       ^
  164. 
  165. char *av_strdup(const char *s)

libavcodec/sonic.c:808:10: 
806.     // generate taps
807.     s->tap_quant = av_mallocz(4* s->num_taps);
808.     for (i = 0; i < s->num_taps; i++)
              ^
809.         s->tap_quant[i] = (int)(sqrt(i+1));
810. 

libavcodec/sonic.c:808:17: Loop condition is true. Entering loop body
806.     // generate taps
807.     s->tap_quant = av_mallocz(4* s->num_taps);
808.     for (i = 0; i < s->num_taps; i++)
                     ^
809.         s->tap_quant[i] = (int)(sqrt(i+1));
810. 

libavcodec/sonic.c:809:9: 
807.     s->tap_quant = av_mallocz(4* s->num_taps);
808.     for (i = 0; i < s->num_taps; i++)
809.         s->tap_quant[i] = (int)(sqrt(i+1));
             ^
810. 
811.     s->predictor_k = av_mallocz(4* s->num_taps);

static av_cold int sonic_decode_init(AVCodecContext *avctx)
{
    SonicContext *s = avctx->priv_data;
    GetBitContext gb;
    int i, version;
    s->channels = avctx->channels;
    s->samplerate = avctx->sample_rate;
    if (!avctx->extradata)
    {
        av_log(avctx, AV_LOG_ERROR, "No mandatory headers present\n");
        return -1;
    }
    init_get_bits(&gb, avctx->extradata, avctx->extradata_size);
    version = get_bits(&gb, 2);
    if (version > 1)
    {
        av_log(avctx, AV_LOG_ERROR, "Unsupported Sonic version, please report\n");
        return -1;
    }
    if (version == 1)
    {
        s->channels = get_bits(&gb, 2);
        s->samplerate = samplerate_table[get_bits(&gb, 4)];
        av_log(avctx, AV_LOG_INFO, "Sonicv2 chans: %d samprate: %d\n",
            s->channels, s->samplerate);
    }
    if (s->channels > MAX_CHANNELS)
    {
        av_log(avctx, AV_LOG_ERROR, "Only mono and stereo streams are supported by now\n");
        return -1;
    }
    s->lossless = get_bits1(&gb);
    if (!s->lossless)
        skip_bits(&gb, 3);
    s->decorrelation = get_bits(&gb, 2);
    s->downsampling = get_bits(&gb, 2);
    s->num_taps = (get_bits(&gb, 5)+1)<<5;
    if (get_bits1(&gb))
        av_log(avctx, AV_LOG_INFO, "Custom quant table\n");
    s->block_align = (int)(2048.0*(s->samplerate/44100))/s->downsampling;
    s->frame_size = s->channels*s->block_align*s->downsampling;
    av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n",
        version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);
    s->tap_quant = av_mallocz(4* s->num_taps);
    for (i = 0; i < s->num_taps; i++)
        s->tap_quant[i] = (int)(sqrt(i+1));
    s->predictor_k = av_mallocz(4* s->num_taps);
    for (i = 0; i < s->channels; i++)
    {
        s->predictor_state[i] = av_mallocz(4* s->num_taps);
        if (!s->predictor_state[i])
            return -1;
    }
    for (i = 0; i < s->channels; i++)
    {
        s->coded_samples[i] = av_mallocz(4* s->block_align);
        if (!s->coded_samples[i])
            return -1;
    }
    s->int_samples = av_mallocz(4* s->frame_size);
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
    return 0;
}
['static av_cold int sonic_decode_init(AVCodecContext *avctx)\n{\n    SonicContext *s = avctx->priv_data;\n    GetBitContext gb;\n    int i, version;\n    s->channels = avctx->channels;\n    s->samplerate = avctx->sample_rate;\n    if (!avctx->extradata)\n    {\n        av_log(avctx, AV_LOG_ERROR, "No mandatory headers present\\n");\n        return -1;\n    }\n    init_get_bits(&gb, avctx->extradata, avctx->extradata_size);\n    version = get_bits(&gb, 2);\n    if (version > 1)\n    {\n        av_log(avctx, AV_LOG_ERROR, "Unsupported Sonic version, please report\\n");\n        return -1;\n    }\n    if (version == 1)\n    {\n        s->channels = get_bits(&gb, 2);\n        s->samplerate = samplerate_table[get_bits(&gb, 4)];\n        av_log(avctx, AV_LOG_INFO, "Sonicv2 chans: %d samprate: %d\\n",\n            s->channels, s->samplerate);\n    }\n    if (s->channels > MAX_CHANNELS)\n    {\n        av_log(avctx, AV_LOG_ERROR, "Only mono and stereo streams are supported by now\\n");\n        return -1;\n    }\n    s->lossless = get_bits1(&gb);\n    if (!s->lossless)\n        skip_bits(&gb, 3);\n    s->decorrelation = get_bits(&gb, 2);\n    s->downsampling = get_bits(&gb, 2);\n    s->num_taps = (get_bits(&gb, 5)+1)<<5;\n    if (get_bits1(&gb))\n        av_log(avctx, AV_LOG_INFO, "Custom quant table\\n");\n    s->block_align = (int)(2048.0*(s->samplerate/44100))/s->downsampling;\n    s->frame_size = s->channels*s->block_align*s->downsampling;\n    av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\\n",\n        version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);\n    s->tap_quant = av_mallocz(4* s->num_taps);\n    for (i = 0; i < s->num_taps; i++)\n        s->tap_quant[i] = (int)(sqrt(i+1));\n    s->predictor_k = av_mallocz(4* s->num_taps);\n    for (i = 0; i < s->channels; i++)\n    {\n        s->predictor_state[i] = av_mallocz(4* s->num_taps);\n        if (!s->predictor_state[i])\n            return -1;\n    }\n    for (i = 0; i < s->channels; i++)\n    {\n        s->coded_samples[i] = av_mallocz(4* s->block_align);\n        if (!s->coded_samples[i])\n            return -1;\n    }\n    s->int_samples = av_mallocz(4* s->frame_size);\n    avctx->sample_fmt = AV_SAMPLE_FMT_S16;\n    return 0;\n}', 'static inline void init_get_bits(GetBitContext *s,\n                   const uint8_t *buffer, int bit_size)\n{\n    int buffer_size = (bit_size+7)>>3;\n    if (buffer_size < 0 || bit_size < 0) {\n        buffer_size = bit_size = 0;\n        buffer = NULL;\n    }\n    s->buffer       = buffer;\n    s->size_in_bits = bit_size;\n    s->buffer_end   = buffer + buffer_size;\n#ifdef ALT_BITSTREAM_READER\n    s->index        = 0;\n#elif defined A32_BITSTREAM_READER\n    s->buffer_ptr   = (uint32_t*)((intptr_t)buffer & ~3);\n    s->bit_count    = 32 +     8*((intptr_t)buffer &  3);\n    skip_bits_long(s, 0);\n#endif\n}', 'static inline unsigned int get_bits(GetBitContext *s, int n){\n    register int tmp;\n    OPEN_READER(re, s);\n    UPDATE_CACHE(re, s);\n    tmp = SHOW_UBITS(re, s, n);\n    LAST_SKIP_BITS(re, s, n);\n    CLOSE_READER(re, s);\n    return tmp;\n}', 'static av_always_inline av_const uint32_t av_bswap32(uint32_t x)\n{\n    x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);\n    x= (x>>16) | (x<<16);\n    return x;\n}', 'static inline unsigned int get_bits1(GetBitContext *s){\n#ifdef ALT_BITSTREAM_READER\n    unsigned int index = s->index;\n    uint8_t result = s->buffer[index>>3];\n#ifdef ALT_BITSTREAM_READER_LE\n    result >>= index & 7;\n    result &= 1;\n#else\n    result <<= index & 7;\n    result >>= 8 - 1;\n#endif\n    index++;\n    s->index = index;\n    return result;\n#else\n    return get_bits(s, 1);\n#endif\n}', 'void *av_mallocz(FF_INTERNAL_MEM_TYPE size)\n{\n    void *ptr = av_malloc(size);\n    if (ptr)\n        memset(ptr, 0, size);\n    return ptr;\n}', 'void *av_malloc(FF_INTERNAL_MEM_TYPE 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}']