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

libavcodec/alacenc.c:465:1: start of procedure alac_encode_frame()
463. }
464. 
465. static int alac_encode_frame(AVCodecContext *avctx, uint8_t *frame,
     ^
466.                              int buf_size, void *data)
467. {

libavcodec/alacenc.c:468:5: 
466.                              int buf_size, void *data)
467. {
468.     AlacEncodeContext *s = avctx->priv_data;
         ^
469.     PutBitContext *pb = &s->pbctx;
470.     int i, out_bytes, verbatim_flag = 0;

libavcodec/alacenc.c:469:5: 
467. {
468.     AlacEncodeContext *s = avctx->priv_data;
469.     PutBitContext *pb = &s->pbctx;
         ^
470.     int i, out_bytes, verbatim_flag = 0;
471. 

libavcodec/alacenc.c:470:5: 
468.     AlacEncodeContext *s = avctx->priv_data;
469.     PutBitContext *pb = &s->pbctx;
470.     int i, out_bytes, verbatim_flag = 0;
         ^
471. 
472.     if(avctx->frame_size > DEFAULT_FRAME_SIZE) {

libavcodec/alacenc.c:472:8: Taking false branch
470.     int i, out_bytes, verbatim_flag = 0;
471. 
472.     if(avctx->frame_size > DEFAULT_FRAME_SIZE) {
            ^
473.         av_log(avctx, AV_LOG_ERROR, "input frame size exceeded\n");
474.         return -1;

libavcodec/alacenc.c:477:8: Taking false branch
475.     }
476. 
477.     if(buf_size < 2*s->max_coded_frame_size) {
            ^
478.         av_log(avctx, AV_LOG_ERROR, "buffer size is too small\n");
479.         return -1;

libavcodec/alacenc.c:510:9: 
508.         }
509.         verbatim_flag = 1;
510.         goto verbatim;
             ^
511.     }
512. 

libavcodec/alacenc.c:483:5: 
481. 
482. verbatim:
483.     init_put_bits(pb, frame, buf_size);
         ^
484. 
485.     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:485:9: Taking true branch
483.     init_put_bits(pb, frame, buf_size);
484. 
485.     if((s->compression_level == 0) || verbatim_flag) {
             ^
486.         // Verbatim mode
487.         const int16_t *samples = data;

libavcodec/alacenc.c:487:9: 
485.     if((s->compression_level == 0) || verbatim_flag) {
486.         // Verbatim mode
487.         const int16_t *samples = data;
             ^
488.         write_frame_header(s, 1);
489.         for(i=0; i<avctx->frame_size*avctx->channels; i++) {

libavcodec/alacenc.c:488:9: 
486.         // Verbatim mode
487.         const int16_t *samples = data;
488.         write_frame_header(s, 1);
             ^
489.         for(i=0; i<avctx->frame_size*avctx->channels; i++) {
490.             put_sbits(pb, 16, *samples++);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

libavcodec/put_bits.h:156:9: 
      154.         bit_buf<<=bit_left;
      155.         bit_buf |= value >> (n - bit_left);
      156.         AV_WB32(s->buf_ptr, bit_buf);
                   ^
      157.         //printf("bitbuf = %08x\n", bit_buf);
      158.         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(avctx->frame_size > DEFAULT_FRAME_SIZE) {
        av_log(avctx, AV_LOG_ERROR, "input frame size exceeded\n");
        return -1;
    }
    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(avctx->frame_size > DEFAULT_FRAME_SIZE) {\n        av_log(avctx, AV_LOG_ERROR, "input frame size exceeded\\n");\n        return -1;\n    }\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    x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);\n    x= (x>>16) | (x<<16);\n    return 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}']