libavcodec/alacenc.c:506: error: Null Dereference
  pointer `s->pbctx.buf_ptr` last assigned on line 501 could be null and is dereferenced by call to `write_frame_header()` at line 506, column 9.

libavcodec/alacenc.c:488:1: start of procedure alac_encode_frame()
486. }
487. 
488. static int alac_encode_frame(AVCodecContext *avctx, uint8_t *frame,
     ^
489.                              int buf_size, void *data)
490. {

libavcodec/alacenc.c:491:5: 
489.                              int buf_size, void *data)
490. {
491.     AlacEncodeContext *s = avctx->priv_data;
         ^
492.     PutBitContext *pb = &s->pbctx;
493.     int i, out_bytes, verbatim_flag = 0;

libavcodec/alacenc.c:492:5: 
490. {
491.     AlacEncodeContext *s = avctx->priv_data;
492.     PutBitContext *pb = &s->pbctx;
         ^
493.     int i, out_bytes, verbatim_flag = 0;
494. 

libavcodec/alacenc.c:493:5: 
491.     AlacEncodeContext *s = avctx->priv_data;
492.     PutBitContext *pb = &s->pbctx;
493.     int i, out_bytes, verbatim_flag = 0;
         ^
494. 
495.     if (buf_size < 2 * s->max_coded_frame_size) {

libavcodec/alacenc.c:495:9: Taking false branch
493.     int i, out_bytes, verbatim_flag = 0;
494. 
495.     if (buf_size < 2 * s->max_coded_frame_size) {
             ^
496.         av_log(avctx, AV_LOG_ERROR, "buffer size is too small\n");
497.         return -1;

libavcodec/alacenc.c:528:9: 
526.         }
527.         verbatim_flag = 1;
528.         goto verbatim;
             ^
529.     }
530. 

libavcodec/alacenc.c:501:5: 
499. 
500. verbatim:
501.     init_put_bits(pb, frame, buf_size);
         ^
502. 
503.     if (s->compression_level == 0 || verbatim_flag) {

libavcodec/put_bits.h:52:1: start of procedure init_put_bits()
  50.  * @param buffer_size the size in bytes of buffer
  51.  */
  52. static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
      ^
  53. {
  54.     if(buffer_size < 0) {

libavcodec/put_bits.h:54:8: Taking true branch
  52. static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
  53. {
  54.     if(buffer_size < 0) {
             ^
  55.         buffer_size = 0;
  56.         buffer = NULL;

libavcodec/put_bits.h:55:9: 
  53. {
  54.     if(buffer_size < 0) {
  55.         buffer_size = 0;
              ^
  56.         buffer = NULL;
  57.     }

libavcodec/put_bits.h:56:9: 
  54.     if(buffer_size < 0) {
  55.         buffer_size = 0;
  56.         buffer = NULL;
              ^
  57.     }
  58. 

libavcodec/put_bits.h:59:5: 
  57.     }
  58. 
  59.     s->size_in_bits= 8*buffer_size;
          ^
  60.     s->buf = buffer;
  61.     s->buf_end = s->buf + buffer_size;

libavcodec/put_bits.h:60:5: 
  58. 
  59.     s->size_in_bits= 8*buffer_size;
  60.     s->buf = buffer;
          ^
  61.     s->buf_end = s->buf + buffer_size;
  62.     s->buf_ptr = s->buf;

libavcodec/put_bits.h:61:5: 
  59.     s->size_in_bits= 8*buffer_size;
  60.     s->buf = buffer;
  61.     s->buf_end = s->buf + buffer_size;
          ^
  62.     s->buf_ptr = s->buf;
  63.     s->bit_left=32;

libavcodec/put_bits.h:62:5: 
  60.     s->buf = buffer;
  61.     s->buf_end = s->buf + buffer_size;
  62.     s->buf_ptr = s->buf;
          ^
  63.     s->bit_left=32;
  64.     s->bit_buf=0;

libavcodec/put_bits.h:63:5: 
  61.     s->buf_end = s->buf + buffer_size;
  62.     s->buf_ptr = s->buf;
  63.     s->bit_left=32;
          ^
  64.     s->bit_buf=0;
  65. }

libavcodec/put_bits.h:64:5: 
  62.     s->buf_ptr = s->buf;
  63.     s->bit_left=32;
  64.     s->bit_buf=0;
          ^
  65. }
  66. 

libavcodec/put_bits.h:65:1: return from a call to init_put_bits
  63.     s->bit_left=32;
  64.     s->bit_buf=0;
  65. }
      ^
  66. 
  67. /**

libavcodec/alacenc.c:503:9: Taking true branch
501.     init_put_bits(pb, frame, buf_size);
502. 
503.     if (s->compression_level == 0 || verbatim_flag) {
             ^
504.         // Verbatim mode
505.         const int16_t *samples = data;

libavcodec/alacenc.c:505:9: 
503.     if (s->compression_level == 0 || verbatim_flag) {
504.         // Verbatim mode
505.         const int16_t *samples = data;
             ^
506.         write_frame_header(s, 1);
507.         for (i = 0; i < avctx->frame_size * avctx->channels; i++) {

libavcodec/alacenc.c:506:9: 
504.         // Verbatim mode
505.         const int16_t *samples = data;
506.         write_frame_header(s, 1);
             ^
507.         for (i = 0; i < avctx->frame_size * avctx->channels; i++) {
508.             put_sbits(pb, 16, *samples++);

libavcodec/alacenc.c:120:1: start of procedure write_frame_header()
  118. }
  119. 
  120. static void write_frame_header(AlacEncodeContext *s, int is_verbatim)
       ^
  121. {
  122.     put_bits(&s->pbctx, 3,  s->avctx->channels-1);          // No. of channels -1

libavcodec/alacenc.c:122:5: 
  120. static void write_frame_header(AlacEncodeContext *s, int is_verbatim)
  121. {
  122.     put_bits(&s->pbctx, 3,  s->avctx->channels-1);          // No. of channels -1
           ^
  123.     put_bits(&s->pbctx, 16, 0);                             // Seems to be zero
  124.     put_bits(&s->pbctx, 1,  1);                             // Sample count is in the header

libavcodec/put_bits.h:128:1: start of procedure put_bits()
    126.  * Use put_bits32 to write 32 bits.
    127.  */
    128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         ^
    129. {
    130.     unsigned int bit_buf;

libavcodec/put_bits.h:134:5: 
    132. 
    133.     //    printf("put_bits=%d %x\n", n, value);
    134.     assert(n <= 31 && value < (1U << n));
             ^
    135. 
    136.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:136:5: 
    134.     assert(n <= 31 && value < (1U << n));
    135. 
    136.     bit_buf = s->bit_buf;
             ^
    137.     bit_left = s->bit_left;
    138. 

libavcodec/put_bits.h:137:5: 
    135. 
    136.     bit_buf = s->bit_buf;
    137.     bit_left = s->bit_left;
             ^
    138. 
    139.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:151:9: Taking false branch
    149.     bit_left-=n;
    150. #else
    151.     if (n < bit_left) {
                 ^
    152.         bit_buf = (bit_buf<<n) | value;
    153.         bit_left-=n;

libavcodec/put_bits.h:155:9: 
    153.         bit_left-=n;
    154.     } else {
    155.         bit_buf<<=bit_left;
                 ^
    156.         bit_buf |= value >> (n - bit_left);
    157.         AV_WB32(s->buf_ptr, bit_buf);

libavcodec/put_bits.h:156:9: 
    154.     } else {
    155.         bit_buf<<=bit_left;
    156.         bit_buf |= value >> (n - bit_left);
                 ^
    157.         AV_WB32(s->buf_ptr, bit_buf);
    158.         //printf("bitbuf = %08x\n", bit_buf);

libavcodec/put_bits.h:157:9: 
    155.         bit_buf<<=bit_left;
    156.         bit_buf |= value >> (n - bit_left);
    157.         AV_WB32(s->buf_ptr, bit_buf);
                 ^
    158.         //printf("bitbuf = %08x\n", bit_buf);
    159.         s->buf_ptr+=4;

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/put_bits.h:159:9: 
    157.         AV_WB32(s->buf_ptr, bit_buf);
    158.         //printf("bitbuf = %08x\n", bit_buf);
    159.         s->buf_ptr+=4;
                 ^
    160.         bit_left+=32 - n;
    161.         bit_buf = value;

libavcodec/put_bits.h:160:9: 
    158.         //printf("bitbuf = %08x\n", bit_buf);
    159.         s->buf_ptr+=4;
    160.         bit_left+=32 - n;
                 ^
    161.         bit_buf = value;
    162.     }

libavcodec/put_bits.h:161:9: 
    159.         s->buf_ptr+=4;
    160.         bit_left+=32 - n;
    161.         bit_buf = value;
                 ^
    162.     }
    163. #endif

libavcodec/put_bits.h:165:5: 
    163. #endif
    164. 
    165.     s->bit_buf = bit_buf;
             ^
    166.     s->bit_left = bit_left;
    167. }

libavcodec/put_bits.h:166:5: 
    164. 
    165.     s->bit_buf = bit_buf;
    166.     s->bit_left = bit_left;
             ^
    167. }
    168. 

libavcodec/put_bits.h:167:1: return from a call to put_bits
    165.     s->bit_buf = bit_buf;
    166.     s->bit_left = bit_left;
    167. }
         ^
    168. 
    169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)

libavcodec/alacenc.c:123:5: 
  121. {
  122.     put_bits(&s->pbctx, 3,  s->avctx->channels-1);          // No. of channels -1
  123.     put_bits(&s->pbctx, 16, 0);                             // Seems to be zero
           ^
  124.     put_bits(&s->pbctx, 1,  1);                             // Sample count is in the header
  125.     put_bits(&s->pbctx, 2,  0);                             // FIXME: Wasted bytes field

libavcodec/put_bits.h:128:1: start of procedure put_bits()
    126.  * Use put_bits32 to write 32 bits.
    127.  */
    128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         ^
    129. {
    130.     unsigned int bit_buf;

libavcodec/put_bits.h:134:5: 
    132. 
    133.     //    printf("put_bits=%d %x\n", n, value);
    134.     assert(n <= 31 && value < (1U << n));
             ^
    135. 
    136.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:136:5: 
    134.     assert(n <= 31 && value < (1U << n));
    135. 
    136.     bit_buf = s->bit_buf;
             ^
    137.     bit_left = s->bit_left;
    138. 

libavcodec/put_bits.h:137:5: 
    135. 
    136.     bit_buf = s->bit_buf;
    137.     bit_left = s->bit_left;
             ^
    138. 
    139.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:151:9: Taking true branch
    149.     bit_left-=n;
    150. #else
    151.     if (n < bit_left) {
                 ^
    152.         bit_buf = (bit_buf<<n) | value;
    153.         bit_left-=n;

libavcodec/put_bits.h:152:9: 
    150. #else
    151.     if (n < bit_left) {
    152.         bit_buf = (bit_buf<<n) | value;
                 ^
    153.         bit_left-=n;
    154.     } else {

libavcodec/put_bits.h:153:9: 
    151.     if (n < bit_left) {
    152.         bit_buf = (bit_buf<<n) | value;
    153.         bit_left-=n;
                 ^
    154.     } else {
    155.         bit_buf<<=bit_left;

libavcodec/put_bits.h:165:5: 
    163. #endif
    164. 
    165.     s->bit_buf = bit_buf;
             ^
    166.     s->bit_left = bit_left;
    167. }

libavcodec/put_bits.h:166:5: 
    164. 
    165.     s->bit_buf = bit_buf;
    166.     s->bit_left = bit_left;
             ^
    167. }
    168. 

libavcodec/put_bits.h:167:1: return from a call to put_bits
    165.     s->bit_buf = bit_buf;
    166.     s->bit_left = bit_left;
    167. }
         ^
    168. 
    169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)

libavcodec/alacenc.c:124:5: 
  122.     put_bits(&s->pbctx, 3,  s->avctx->channels-1);          // No. of channels -1
  123.     put_bits(&s->pbctx, 16, 0);                             // Seems to be zero
  124.     put_bits(&s->pbctx, 1,  1);                             // Sample count is in the header
           ^
  125.     put_bits(&s->pbctx, 2,  0);                             // FIXME: Wasted bytes field
  126.     put_bits(&s->pbctx, 1,  is_verbatim);                   // Audio block is verbatim

libavcodec/put_bits.h:128:1: start of procedure put_bits()
    126.  * Use put_bits32 to write 32 bits.
    127.  */
    128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         ^
    129. {
    130.     unsigned int bit_buf;

libavcodec/put_bits.h:134:5: 
    132. 
    133.     //    printf("put_bits=%d %x\n", n, value);
    134.     assert(n <= 31 && value < (1U << n));
             ^
    135. 
    136.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:136:5: 
    134.     assert(n <= 31 && value < (1U << n));
    135. 
    136.     bit_buf = s->bit_buf;
             ^
    137.     bit_left = s->bit_left;
    138. 

libavcodec/put_bits.h:137:5: 
    135. 
    136.     bit_buf = s->bit_buf;
    137.     bit_left = s->bit_left;
             ^
    138. 
    139.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:151:9: Taking true branch
    149.     bit_left-=n;
    150. #else
    151.     if (n < bit_left) {
                 ^
    152.         bit_buf = (bit_buf<<n) | value;
    153.         bit_left-=n;

libavcodec/put_bits.h:152:9: 
    150. #else
    151.     if (n < bit_left) {
    152.         bit_buf = (bit_buf<<n) | value;
                 ^
    153.         bit_left-=n;
    154.     } else {

libavcodec/put_bits.h:153:9: 
    151.     if (n < bit_left) {
    152.         bit_buf = (bit_buf<<n) | value;
    153.         bit_left-=n;
                 ^
    154.     } else {
    155.         bit_buf<<=bit_left;

libavcodec/put_bits.h:165:5: 
    163. #endif
    164. 
    165.     s->bit_buf = bit_buf;
             ^
    166.     s->bit_left = bit_left;
    167. }

libavcodec/put_bits.h:166:5: 
    164. 
    165.     s->bit_buf = bit_buf;
    166.     s->bit_left = bit_left;
             ^
    167. }
    168. 

libavcodec/put_bits.h:167:1: return from a call to put_bits
    165.     s->bit_buf = bit_buf;
    166.     s->bit_left = bit_left;
    167. }
         ^
    168. 
    169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)

libavcodec/alacenc.c:125:5: 
  123.     put_bits(&s->pbctx, 16, 0);                             // Seems to be zero
  124.     put_bits(&s->pbctx, 1,  1);                             // Sample count is in the header
  125.     put_bits(&s->pbctx, 2,  0);                             // FIXME: Wasted bytes field
           ^
  126.     put_bits(&s->pbctx, 1,  is_verbatim);                   // Audio block is verbatim
  127.     put_bits32(&s->pbctx, s->avctx->frame_size);            // No. of samples in the frame

libavcodec/put_bits.h:128:1: start of procedure put_bits()
    126.  * Use put_bits32 to write 32 bits.
    127.  */
    128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         ^
    129. {
    130.     unsigned int bit_buf;

libavcodec/put_bits.h:134:5: 
    132. 
    133.     //    printf("put_bits=%d %x\n", n, value);
    134.     assert(n <= 31 && value < (1U << n));
             ^
    135. 
    136.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:136:5: 
    134.     assert(n <= 31 && value < (1U << n));
    135. 
    136.     bit_buf = s->bit_buf;
             ^
    137.     bit_left = s->bit_left;
    138. 

libavcodec/put_bits.h:137:5: 
    135. 
    136.     bit_buf = s->bit_buf;
    137.     bit_left = s->bit_left;
             ^
    138. 
    139.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:151:9: Taking true branch
    149.     bit_left-=n;
    150. #else
    151.     if (n < bit_left) {
                 ^
    152.         bit_buf = (bit_buf<<n) | value;
    153.         bit_left-=n;

libavcodec/put_bits.h:152:9: 
    150. #else
    151.     if (n < bit_left) {
    152.         bit_buf = (bit_buf<<n) | value;
                 ^
    153.         bit_left-=n;
    154.     } else {

libavcodec/put_bits.h:153:9: 
    151.     if (n < bit_left) {
    152.         bit_buf = (bit_buf<<n) | value;
    153.         bit_left-=n;
                 ^
    154.     } else {
    155.         bit_buf<<=bit_left;

libavcodec/put_bits.h:165:5: 
    163. #endif
    164. 
    165.     s->bit_buf = bit_buf;
             ^
    166.     s->bit_left = bit_left;
    167. }

libavcodec/put_bits.h:166:5: 
    164. 
    165.     s->bit_buf = bit_buf;
    166.     s->bit_left = bit_left;
             ^
    167. }
    168. 

libavcodec/put_bits.h:167:1: return from a call to put_bits
    165.     s->bit_buf = bit_buf;
    166.     s->bit_left = bit_left;
    167. }
         ^
    168. 
    169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)

libavcodec/alacenc.c:126:5: 
  124.     put_bits(&s->pbctx, 1,  1);                             // Sample count is in the header
  125.     put_bits(&s->pbctx, 2,  0);                             // FIXME: Wasted bytes field
  126.     put_bits(&s->pbctx, 1,  is_verbatim);                   // Audio block is verbatim
           ^
  127.     put_bits32(&s->pbctx, s->avctx->frame_size);            // No. of samples in the frame
  128. }

libavcodec/put_bits.h:128:1: start of procedure put_bits()
    126.  * Use put_bits32 to write 32 bits.
    127.  */
    128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         ^
    129. {
    130.     unsigned int bit_buf;

libavcodec/put_bits.h:134:5: 
    132. 
    133.     //    printf("put_bits=%d %x\n", n, value);
    134.     assert(n <= 31 && value < (1U << n));
             ^
    135. 
    136.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:136:5: 
    134.     assert(n <= 31 && value < (1U << n));
    135. 
    136.     bit_buf = s->bit_buf;
             ^
    137.     bit_left = s->bit_left;
    138. 

libavcodec/put_bits.h:137:5: 
    135. 
    136.     bit_buf = s->bit_buf;
    137.     bit_left = s->bit_left;
             ^
    138. 
    139.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:151:9: Taking true branch
    149.     bit_left-=n;
    150. #else
    151.     if (n < bit_left) {
                 ^
    152.         bit_buf = (bit_buf<<n) | value;
    153.         bit_left-=n;

libavcodec/put_bits.h:152:9: 
    150. #else
    151.     if (n < bit_left) {
    152.         bit_buf = (bit_buf<<n) | value;
                 ^
    153.         bit_left-=n;
    154.     } else {

libavcodec/put_bits.h:153:9: 
    151.     if (n < bit_left) {
    152.         bit_buf = (bit_buf<<n) | value;
    153.         bit_left-=n;
                 ^
    154.     } else {
    155.         bit_buf<<=bit_left;

libavcodec/put_bits.h:165:5: 
    163. #endif
    164. 
    165.     s->bit_buf = bit_buf;
             ^
    166.     s->bit_left = bit_left;
    167. }

libavcodec/put_bits.h:166:5: 
    164. 
    165.     s->bit_buf = bit_buf;
    166.     s->bit_left = bit_left;
             ^
    167. }
    168. 

libavcodec/put_bits.h:167:1: return from a call to put_bits
    165.     s->bit_buf = bit_buf;
    166.     s->bit_left = bit_left;
    167. }
         ^
    168. 
    169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)

libavcodec/alacenc.c:127:5: 
  125.     put_bits(&s->pbctx, 2,  0);                             // FIXME: Wasted bytes field
  126.     put_bits(&s->pbctx, 1,  is_verbatim);                   // Audio block is verbatim
  127.     put_bits32(&s->pbctx, s->avctx->frame_size);            // No. of samples in the frame
           ^
  128. }
  129. 

libavcodec/put_bits.h:179:1: start of procedure put_bits32()
    177.  * Write exactly 32 bits into a bitstream.
    178.  */
    179. static void av_unused put_bits32(PutBitContext *s, uint32_t value)
         ^
    180. {
    181.     int lo = value & 0xffff;

libavcodec/put_bits.h:181:5: 
    179. static void av_unused put_bits32(PutBitContext *s, uint32_t value)
    180. {
    181.     int lo = value & 0xffff;
             ^
    182.     int hi = value >> 16;
    183. #ifdef BITSTREAM_WRITER_LE

libavcodec/put_bits.h:182:5: 
    180. {
    181.     int lo = value & 0xffff;
    182.     int hi = value >> 16;
             ^
    183. #ifdef BITSTREAM_WRITER_LE
    184.     put_bits(s, 16, lo);

libavcodec/put_bits.h:184:5: 
    182.     int hi = value >> 16;
    183. #ifdef BITSTREAM_WRITER_LE
    184.     put_bits(s, 16, lo);
             ^
    185.     put_bits(s, 16, hi);
    186. #else

libavcodec/put_bits.h:128:1: start of procedure put_bits()
      126.  * Use put_bits32 to write 32 bits.
      127.  */
      128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
           ^
      129. {
      130.     unsigned int bit_buf;

libavcodec/put_bits.h:134:5: 
      132. 
      133.     //    printf("put_bits=%d %x\n", n, value);
      134.     assert(n <= 31 && value < (1U << n));
               ^
      135. 
      136.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:136:5: 
      134.     assert(n <= 31 && value < (1U << n));
      135. 
      136.     bit_buf = s->bit_buf;
               ^
      137.     bit_left = s->bit_left;
      138. 

libavcodec/put_bits.h:137:5: 
      135. 
      136.     bit_buf = s->bit_buf;
      137.     bit_left = s->bit_left;
               ^
      138. 
      139.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:151:9: Taking true branch
      149.     bit_left-=n;
      150. #else
      151.     if (n < bit_left) {
                   ^
      152.         bit_buf = (bit_buf<<n) | value;
      153.         bit_left-=n;

libavcodec/put_bits.h:152:9: 
      150. #else
      151.     if (n < bit_left) {
      152.         bit_buf = (bit_buf<<n) | value;
                   ^
      153.         bit_left-=n;
      154.     } else {

libavcodec/put_bits.h:153:9: 
      151.     if (n < bit_left) {
      152.         bit_buf = (bit_buf<<n) | value;
      153.         bit_left-=n;
                   ^
      154.     } else {
      155.         bit_buf<<=bit_left;

libavcodec/put_bits.h:165:5: 
      163. #endif
      164. 
      165.     s->bit_buf = bit_buf;
               ^
      166.     s->bit_left = bit_left;
      167. }

libavcodec/put_bits.h:166:5: 
      164. 
      165.     s->bit_buf = bit_buf;
      166.     s->bit_left = bit_left;
               ^
      167. }
      168. 

libavcodec/put_bits.h:167:1: return from a call to put_bits
      165.     s->bit_buf = bit_buf;
      166.     s->bit_left = bit_left;
      167. }
           ^
      168. 
      169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value)

libavcodec/put_bits.h:185:5: 
    183. #ifdef BITSTREAM_WRITER_LE
    184.     put_bits(s, 16, lo);
    185.     put_bits(s, 16, hi);
             ^
    186. #else
    187.     put_bits(s, 16, hi);

libavcodec/put_bits.h:128:1: start of procedure put_bits()
      126.  * Use put_bits32 to write 32 bits.
      127.  */
      128. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
           ^
      129. {
      130.     unsigned int bit_buf;

libavcodec/put_bits.h:134:5: 
      132. 
      133.     //    printf("put_bits=%d %x\n", n, value);
      134.     assert(n <= 31 && value < (1U << n));
               ^
      135. 
      136.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:136:5: 
      134.     assert(n <= 31 && value < (1U << n));
      135. 
      136.     bit_buf = s->bit_buf;
               ^
      137.     bit_left = s->bit_left;
      138. 

libavcodec/put_bits.h:137:5: 
      135. 
      136.     bit_buf = s->bit_buf;
      137.     bit_left = s->bit_left;
               ^
      138. 
      139.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:151:9: Taking false branch
      149.     bit_left-=n;
      150. #else
      151.     if (n < bit_left) {
                   ^
      152.         bit_buf = (bit_buf<<n) | value;
      153.         bit_left-=n;

libavcodec/put_bits.h:155:9: 
      153.         bit_left-=n;
      154.     } else {
      155.         bit_buf<<=bit_left;
                   ^
      156.         bit_buf |= value >> (n - bit_left);
      157.         AV_WB32(s->buf_ptr, bit_buf);

libavcodec/put_bits.h:156:9: 
      154.     } else {
      155.         bit_buf<<=bit_left;
      156.         bit_buf |= value >> (n - bit_left);
                   ^
      157.         AV_WB32(s->buf_ptr, bit_buf);
      158.         //printf("bitbuf = %08x\n", bit_buf);

libavcodec/put_bits.h:157:9: 
      155.         bit_buf<<=bit_left;
      156.         bit_buf |= value >> (n - bit_left);
      157.         AV_WB32(s->buf_ptr, bit_buf);
                   ^
      158.         //printf("bitbuf = %08x\n", bit_buf);
      159.         s->buf_ptr+=4;

static int alac_encode_frame(AVCodecContext *avctx, uint8_t *frame,
                             int buf_size, void *data)
{
    AlacEncodeContext *s = avctx->priv_data;
    PutBitContext *pb = &s->pbctx;
    int i, out_bytes, verbatim_flag = 0;
    if (buf_size < 2 * s->max_coded_frame_size) {
        av_log(avctx, AV_LOG_ERROR, "buffer size is too small\n");
        return -1;
    }
verbatim:
    init_put_bits(pb, frame, buf_size);
    if (s->compression_level == 0 || verbatim_flag) {
        const int16_t *samples = data;
        write_frame_header(s, 1);
        for (i = 0; i < avctx->frame_size * avctx->channels; i++) {
            put_sbits(pb, 16, *samples++);
        }
    } else {
        init_sample_buffers(s, data);
        write_frame_header(s, 0);
        write_compressed_frame(s);
    }
    put_bits(pb, 3, 7);
    flush_put_bits(pb);
    out_bytes = put_bits_count(pb) >> 3;
    if (out_bytes > s->max_coded_frame_size) {
        if (verbatim_flag || s->compression_level == 0) {
            av_log(avctx, AV_LOG_ERROR, "error encoding frame\n");
            return -1;
        }
        verbatim_flag = 1;
        goto verbatim;
    }
    return out_bytes;
}
['static int alac_encode_frame(AVCodecContext *avctx, uint8_t *frame,\n                             int buf_size, void *data)\n{\n    AlacEncodeContext *s = avctx->priv_data;\n    PutBitContext *pb = &s->pbctx;\n    int i, out_bytes, verbatim_flag = 0;\n    if (buf_size < 2 * s->max_coded_frame_size) {\n        av_log(avctx, AV_LOG_ERROR, "buffer size is too small\\n");\n        return -1;\n    }\nverbatim:\n    init_put_bits(pb, frame, buf_size);\n    if (s->compression_level == 0 || verbatim_flag) {\n        const int16_t *samples = data;\n        write_frame_header(s, 1);\n        for (i = 0; i < avctx->frame_size * avctx->channels; i++) {\n            put_sbits(pb, 16, *samples++);\n        }\n    } else {\n        init_sample_buffers(s, data);\n        write_frame_header(s, 0);\n        write_compressed_frame(s);\n    }\n    put_bits(pb, 3, 7);\n    flush_put_bits(pb);\n    out_bytes = put_bits_count(pb) >> 3;\n    if (out_bytes > s->max_coded_frame_size) {\n        if (verbatim_flag || s->compression_level == 0) {\n            av_log(avctx, AV_LOG_ERROR, "error encoding frame\\n");\n            return -1;\n        }\n        verbatim_flag = 1;\n        goto verbatim;\n    }\n    return out_bytes;\n}', 'static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)\n{\n    if(buffer_size < 0) {\n        buffer_size = 0;\n        buffer = NULL;\n    }\n    s->size_in_bits= 8*buffer_size;\n    s->buf = buffer;\n    s->buf_end = s->buf + buffer_size;\n    s->buf_ptr = s->buf;\n    s->bit_left=32;\n    s->bit_buf=0;\n}', 'static void write_frame_header(AlacEncodeContext *s, int is_verbatim)\n{\n    put_bits(&s->pbctx, 3,  s->avctx->channels-1);\n    put_bits(&s->pbctx, 16, 0);\n    put_bits(&s->pbctx, 1,  1);\n    put_bits(&s->pbctx, 2,  0);\n    put_bits(&s->pbctx, 1,  is_verbatim);\n    put_bits32(&s->pbctx, s->avctx->frame_size);\n}', 'static inline void put_bits(PutBitContext *s, int n, unsigned int value)\n{\n    unsigned int bit_buf;\n    int bit_left;\n    assert(n <= 31 && value < (1U << n));\n    bit_buf = s->bit_buf;\n    bit_left = s->bit_left;\n#ifdef BITSTREAM_WRITER_LE\n    bit_buf |= value << (32 - bit_left);\n    if (n >= bit_left) {\n        AV_WL32(s->buf_ptr, bit_buf);\n        s->buf_ptr+=4;\n        bit_buf = (bit_left==32)?0:value >> bit_left;\n        bit_left+=32;\n    }\n    bit_left-=n;\n#else\n    if (n < bit_left) {\n        bit_buf = (bit_buf<<n) | value;\n        bit_left-=n;\n    } else {\n        bit_buf<<=bit_left;\n        bit_buf |= value >> (n - bit_left);\n        AV_WB32(s->buf_ptr, bit_buf);\n        s->buf_ptr+=4;\n        bit_left+=32 - n;\n        bit_buf = value;\n    }\n#endif\n    s->bit_buf = bit_buf;\n    s->bit_left = bit_left;\n}', 'static av_always_inline av_const uint32_t av_bswap32(uint32_t x)\n{\n    return AV_BSWAP32C(x);\n}', 'static void av_unused put_bits32(PutBitContext *s, uint32_t value)\n{\n    int lo = value & 0xffff;\n    int hi = value >> 16;\n#ifdef BITSTREAM_WRITER_LE\n    put_bits(s, 16, lo);\n    put_bits(s, 16, hi);\n#else\n    put_bits(s, 16, hi);\n    put_bits(s, 16, lo);\n#endif\n}']