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

libavcodec/sonic.c:754:1: start of procedure sonic_decode_init()
752. 
753. #ifdef CONFIG_DECODERS
754. static av_cold int sonic_decode_init(AVCodecContext *avctx)
     ^
755. {
756.     SonicContext *s = avctx->priv_data;

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

libavcodec/sonic.c:760:5: 
758.     int i, version;
759. 
760.     s->channels = avctx->channels;
         ^
761.     s->samplerate = avctx->sample_rate;
762. 

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

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

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

libavcodec/bitstream.h:758:1: start of procedure init_get_bits()
  756.  * @param bit_size the size of the buffer in bits
  757.  */
  758. static inline void init_get_bits(GetBitContext *s,
       ^
  759.                    const uint8_t *buffer, int bit_size)
  760. {

libavcodec/bitstream.h:761:5: 
  759.                    const uint8_t *buffer, int bit_size)
  760. {
  761.     int buffer_size= (bit_size+7)>>3;
           ^
  762.     if(buffer_size < 0 || bit_size < 0) {
  763.         buffer_size = bit_size = 0;

libavcodec/bitstream.h:762:8: Taking false branch
  760. {
  761.     int buffer_size= (bit_size+7)>>3;
  762.     if(buffer_size < 0 || bit_size < 0) {
              ^
  763.         buffer_size = bit_size = 0;
  764.         buffer = NULL;

libavcodec/bitstream.h:762:27: Taking false branch
  760. {
  761.     int buffer_size= (bit_size+7)>>3;
  762.     if(buffer_size < 0 || bit_size < 0) {
                                 ^
  763.         buffer_size = bit_size = 0;
  764.         buffer = NULL;

libavcodec/bitstream.h:767:5: 
  765.     }
  766. 
  767.     s->buffer= buffer;
           ^
  768.     s->size_in_bits= bit_size;
  769.     s->buffer_end= buffer + buffer_size;

libavcodec/bitstream.h:768:5: 
  766. 
  767.     s->buffer= buffer;
  768.     s->size_in_bits= bit_size;
           ^
  769.     s->buffer_end= buffer + buffer_size;
  770. #ifdef ALT_BITSTREAM_READER

libavcodec/bitstream.h:769:5: 
  767.     s->buffer= buffer;
  768.     s->size_in_bits= bit_size;
  769.     s->buffer_end= buffer + buffer_size;
           ^
  770. #ifdef ALT_BITSTREAM_READER
  771.     s->index=0;

libavcodec/bitstream.h:771:5: 
  769.     s->buffer_end= buffer + buffer_size;
  770. #ifdef ALT_BITSTREAM_READER
  771.     s->index=0;
           ^
  772. #elif defined LIBMPEG2_BITSTREAM_READER
  773.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/bitstream.h:781:1: return from a call to init_get_bits
  779.     skip_bits_long(s, 0);
  780. #endif
  781. }
       ^
  782. 
  783. static inline void align_get_bits(GetBitContext *s)

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

libavcodec/bitstream.h:655:1: start of procedure get_bits()
  653.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
  654.  */
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  656.     register int tmp;
  657.     OPEN_READER(re, s)

libavcodec/bitstream.h:657:5: 
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
  656.     register int tmp;
  657.     OPEN_READER(re, s)
           ^
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:658:5: 
  656.     register int tmp;
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
           ^
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:659:5: 
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
           ^
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)

libavcodec/bitstream.h:660:5: 
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
           ^
  661.     CLOSE_READER(re, s)
  662.     return tmp;

libavcodec/bitstream.h:661:5: 
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
           ^
  662.     return tmp;
  663. }

libavcodec/bitstream.h:662:5: 
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
  662.     return tmp;
           ^
  663. }
  664. 

libavcodec/bitstream.h:663:1: return from a call to get_bits
  661.     CLOSE_READER(re, s)
  662.     return tmp;
  663. }
       ^
  664. 
  665. /**

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

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

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

libavcodec/bitstream.h:655:1: start of procedure get_bits()
  653.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
  654.  */
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  656.     register int tmp;
  657.     OPEN_READER(re, s)

libavcodec/bitstream.h:657:5: 
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
  656.     register int tmp;
  657.     OPEN_READER(re, s)
           ^
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:658:5: 
  656.     register int tmp;
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
           ^
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:659:5: 
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
           ^
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)

libavcodec/bitstream.h:660:5: 
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
           ^
  661.     CLOSE_READER(re, s)
  662.     return tmp;

libavcodec/bitstream.h:661:5: 
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
           ^
  662.     return tmp;
  663. }

libavcodec/bitstream.h:662:5: 
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
  662.     return tmp;
           ^
  663. }
  664. 

libavcodec/bitstream.h:663:1: return from a call to get_bits
  661.     CLOSE_READER(re, s)
  662.     return tmp;
  663. }
       ^
  664. 
  665. /**

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

libavcodec/bitstream.h:655:1: start of procedure get_bits()
  653.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
  654.  */
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  656.     register int tmp;
  657.     OPEN_READER(re, s)

libavcodec/bitstream.h:657:5: 
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
  656.     register int tmp;
  657.     OPEN_READER(re, s)
           ^
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:658:5: 
  656.     register int tmp;
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
           ^
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:659:5: 
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
           ^
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)

libavcodec/bitstream.h:660:5: 
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
           ^
  661.     CLOSE_READER(re, s)
  662.     return tmp;

libavcodec/bitstream.h:661:5: 
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
           ^
  662.     return tmp;
  663. }

libavcodec/bitstream.h:662:5: 
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
  662.     return tmp;
           ^
  663. }
  664. 

libavcodec/bitstream.h:663:1: return from a call to get_bits
  661.     CLOSE_READER(re, s)
  662.     return tmp;
  663. }
       ^
  664. 
  665. /**

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

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

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

libavcodec/bitstream.h:686:1: start of procedure get_bits1()
  684. }
  685. 
  686. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  687. #ifdef ALT_BITSTREAM_READER
  688.     int index= s->index;

libavcodec/bitstream.h:688:5: 
  686. static inline unsigned int get_bits1(GetBitContext *s){
  687. #ifdef ALT_BITSTREAM_READER
  688.     int index= s->index;
           ^
  689.     uint8_t result= s->buffer[ index>>3 ];
  690. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/bitstream.h:689:5: 
  687. #ifdef ALT_BITSTREAM_READER
  688.     int index= s->index;
  689.     uint8_t result= s->buffer[ index>>3 ];
           ^
  690. #ifdef ALT_BITSTREAM_READER_LE
  691.     result>>= (index&0x07);

libavcodec/bitstream.h:694:5: 
  692.     result&= 1;
  693. #else
  694.     result<<= (index&0x07);
           ^
  695.     result>>= 8 - 1;
  696. #endif

libavcodec/bitstream.h:695:5: 
  693. #else
  694.     result<<= (index&0x07);
  695.     result>>= 8 - 1;
           ^
  696. #endif
  697.     index++;

libavcodec/bitstream.h:697:5: 
  695.     result>>= 8 - 1;
  696. #endif
  697.     index++;
           ^
  698.     s->index= index;
  699. 

libavcodec/bitstream.h:698:5: 
  696. #endif
  697.     index++;
  698.     s->index= index;
           ^
  699. 
  700.     return result;

libavcodec/bitstream.h:700:5: 
  698.     s->index= index;
  699. 
  700.     return result;
           ^
  701. #else
  702.     return get_bits(s, 1);

libavcodec/bitstream.h:704:1: return from a call to get_bits1
  702.     return get_bits(s, 1);
  703. #endif
  704. }
       ^
  705. 
  706. static inline unsigned int show_bits1(GetBitContext *s){

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

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

libavcodec/bitstream.h:655:1: start of procedure get_bits()
  653.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
  654.  */
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  656.     register int tmp;
  657.     OPEN_READER(re, s)

libavcodec/bitstream.h:657:5: 
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
  656.     register int tmp;
  657.     OPEN_READER(re, s)
           ^
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:658:5: 
  656.     register int tmp;
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
           ^
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:659:5: 
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
           ^
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)

libavcodec/bitstream.h:660:5: 
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
           ^
  661.     CLOSE_READER(re, s)
  662.     return tmp;

libavcodec/bitstream.h:661:5: 
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
           ^
  662.     return tmp;
  663. }

libavcodec/bitstream.h:662:5: 
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
  662.     return tmp;
           ^
  663. }
  664. 

libavcodec/bitstream.h:663:1: return from a call to get_bits
  661.     CLOSE_READER(re, s)
  662.     return tmp;
  663. }
       ^
  664. 
  665. /**

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

libavcodec/bitstream.h:655:1: start of procedure get_bits()
  653.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
  654.  */
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  656.     register int tmp;
  657.     OPEN_READER(re, s)

libavcodec/bitstream.h:657:5: 
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
  656.     register int tmp;
  657.     OPEN_READER(re, s)
           ^
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:658:5: 
  656.     register int tmp;
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
           ^
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:659:5: 
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
           ^
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)

libavcodec/bitstream.h:660:5: 
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
           ^
  661.     CLOSE_READER(re, s)
  662.     return tmp;

libavcodec/bitstream.h:661:5: 
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
           ^
  662.     return tmp;
  663. }

libavcodec/bitstream.h:662:5: 
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
  662.     return tmp;
           ^
  663. }
  664. 

libavcodec/bitstream.h:663:1: return from a call to get_bits
  661.     CLOSE_READER(re, s)
  662.     return tmp;
  663. }
       ^
  664. 
  665. /**

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

libavcodec/bitstream.h:655:1: start of procedure get_bits()
  653.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
  654.  */
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  656.     register int tmp;
  657.     OPEN_READER(re, s)

libavcodec/bitstream.h:657:5: 
  655. static inline unsigned int get_bits(GetBitContext *s, int n){
  656.     register int tmp;
  657.     OPEN_READER(re, s)
           ^
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:658:5: 
  656.     register int tmp;
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
           ^
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:659:5: 
  657.     OPEN_READER(re, s)
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
           ^
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)

libavcodec/bitstream.h:660:5: 
  658.     UPDATE_CACHE(re, s)
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
           ^
  661.     CLOSE_READER(re, s)
  662.     return tmp;

libavcodec/bitstream.h:661:5: 
  659.     tmp= SHOW_UBITS(re, s, n);
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
           ^
  662.     return tmp;
  663. }

libavcodec/bitstream.h:662:5: 
  660.     LAST_SKIP_BITS(re, s, n)
  661.     CLOSE_READER(re, s)
  662.     return tmp;
           ^
  663. }
  664. 

libavcodec/bitstream.h:663:1: return from a call to get_bits
  661.     CLOSE_READER(re, s)
  662.     return tmp;
  663. }
       ^
  664. 
  665. /**

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

libavcodec/bitstream.h:686:1: start of procedure get_bits1()
  684. }
  685. 
  686. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  687. #ifdef ALT_BITSTREAM_READER
  688.     int index= s->index;

libavcodec/bitstream.h:688:5: 
  686. static inline unsigned int get_bits1(GetBitContext *s){
  687. #ifdef ALT_BITSTREAM_READER
  688.     int index= s->index;
           ^
  689.     uint8_t result= s->buffer[ index>>3 ];
  690. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/bitstream.h:689:5: 
  687. #ifdef ALT_BITSTREAM_READER
  688.     int index= s->index;
  689.     uint8_t result= s->buffer[ index>>3 ];
           ^
  690. #ifdef ALT_BITSTREAM_READER_LE
  691.     result>>= (index&0x07);

libavcodec/bitstream.h:694:5: 
  692.     result&= 1;
  693. #else
  694.     result<<= (index&0x07);
           ^
  695.     result>>= 8 - 1;
  696. #endif

libavcodec/bitstream.h:695:5: 
  693. #else
  694.     result<<= (index&0x07);
  695.     result>>= 8 - 1;
           ^
  696. #endif
  697.     index++;

libavcodec/bitstream.h:697:5: 
  695.     result>>= 8 - 1;
  696. #endif
  697.     index++;
           ^
  698.     s->index= index;
  699. 

libavcodec/bitstream.h:698:5: 
  696. #endif
  697.     index++;
  698.     s->index= index;
           ^
  699. 
  700.     return result;

libavcodec/bitstream.h:700:5: 
  698.     s->index= index;
  699. 
  700.     return result;
           ^
  701. #else
  702.     return get_bits(s, 1);

libavcodec/bitstream.h:704:1: return from a call to get_bits1
  702.     return get_bits(s, 1);
  703. #endif
  704. }
       ^
  705. 
  706. static inline unsigned int show_bits1(GetBitContext *s){

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

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

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

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

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

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

libavutil/mem.c:132:1: start of procedure av_mallocz()
  130. }
  131. 
  132. void *av_mallocz(unsigned int size)
       ^
  133. {
  134.     void *ptr = av_malloc(size);

libavutil/mem.c:134:5: 
  132. void *av_mallocz(unsigned int size)
  133. {
  134.     void *ptr = av_malloc(size);
           ^
  135.     if (ptr)
  136.         memset(ptr, 0, size);

libavutil/mem.c:42:1: start of procedure av_malloc()
    40.    linker will do it automatically */
    41. 
    42. void *av_malloc(unsigned int size)
        ^
    43. {
    44.     void *ptr;

libavutil/mem.c:50:8: Taking true branch
    48. 
    49.     /* let's disallow possible ambiguous cases */
    50.     if(size > (INT_MAX-16) )
               ^
    51.         return NULL;
    52. 

libavutil/mem.c:51:9: 
    49.     /* let's disallow possible ambiguous cases */
    50.     if(size > (INT_MAX-16) )
    51.         return NULL;
                ^
    52. 
    53. #ifdef CONFIG_MEMALIGN_HACK

libavutil/mem.c:92:1: return from a call to av_malloc
    90. #endif
    91.     return ptr;
    92. }
        ^
    93. 
    94. void *av_realloc(void *ptr, unsigned int size)

libavutil/mem.c:135:9: Taking false branch
  133. {
  134.     void *ptr = av_malloc(size);
  135.     if (ptr)
               ^
  136.         memset(ptr, 0, size);
  137.     return ptr;

libavutil/mem.c:137:5: 
  135.     if (ptr)
  136.         memset(ptr, 0, size);
  137.     return ptr;
           ^
  138. }
  139. 

libavutil/mem.c:138:1: return from a call to av_mallocz
  136.         memset(ptr, 0, size);
  137.     return ptr;
  138. }
       ^
  139. 
  140. char *av_strdup(const char *s)

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

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

libavcodec/sonic.c:812:9: 
810.     s->tap_quant = av_mallocz(4* s->num_taps);
811.     for (i = 0; i < s->num_taps; i++)
812.         s->tap_quant[i] = (int)(sqrt(i+1));
             ^
813. 
814.     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);
    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    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 LIBMPEG2_BITSTREAM_READER\n    s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));\n    s->bit_count = 16 + 8*((intptr_t)buffer&1);\n    skip_bits_long(s, 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 inline unsigned int get_bits1(GetBitContext *s){\n#ifdef ALT_BITSTREAM_READER\n    int index= s->index;\n    uint8_t result= s->buffer[ index>>3 ];\n#ifdef ALT_BITSTREAM_READER_LE\n    result>>= (index&0x07);\n    result&= 1;\n#else\n    result<<= (index&0x07);\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(unsigned int size)\n{\n    void *ptr = av_malloc(size);\n    if (ptr)\n        memset(ptr, 0, size);\n    return ptr;\n}', 'void *av_malloc(unsigned int size)\n{\n    void *ptr;\n#ifdef CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#ifdef 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 defined (HAVE_MEMALIGN)\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']