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

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

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

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

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

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

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

libavcodec/alacenc.c:507:9: 
505.         }
506.         verbatim_flag = 1;
507.         goto verbatim;
             ^
508.     }
509. 

libavcodec/alacenc.c:480:5: 
478. 
479. verbatim:
480.     init_put_bits(pb, frame, buf_size);
         ^
481. 
482.     if((s->compression_level == 0) || verbatim_flag) {

libavcodec/put_bits.h:60:1: start of procedure init_put_bits()
  58.  * @param buffer_size the size in bytes of buffer
  59.  */
  60. static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
      ^
  61. {
  62.     if(buffer_size < 0) {

libavcodec/put_bits.h:62:8: Taking true branch
  60. static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
  61. {
  62.     if(buffer_size < 0) {
             ^
  63.         buffer_size = 0;
  64.         buffer = NULL;

libavcodec/put_bits.h:63:9: 
  61. {
  62.     if(buffer_size < 0) {
  63.         buffer_size = 0;
              ^
  64.         buffer = NULL;
  65.     }

libavcodec/put_bits.h:64:9: 
  62.     if(buffer_size < 0) {
  63.         buffer_size = 0;
  64.         buffer = NULL;
              ^
  65.     }
  66. 

libavcodec/put_bits.h:67:5: 
  65.     }
  66. 
  67.     s->size_in_bits= 8*buffer_size;
          ^
  68.     s->buf = buffer;
  69.     s->buf_end = s->buf + buffer_size;

libavcodec/put_bits.h:68:5: 
  66. 
  67.     s->size_in_bits= 8*buffer_size;
  68.     s->buf = buffer;
          ^
  69.     s->buf_end = s->buf + buffer_size;
  70. #ifdef ALT_BITSTREAM_WRITER

libavcodec/put_bits.h:69:5: 
  67.     s->size_in_bits= 8*buffer_size;
  68.     s->buf = buffer;
  69.     s->buf_end = s->buf + buffer_size;
          ^
  70. #ifdef ALT_BITSTREAM_WRITER
  71.     s->index=0;

libavcodec/put_bits.h:75:5: 
  73. //    memset(buffer, 0, buffer_size);
  74. #else
  75.     s->buf_ptr = s->buf;
          ^
  76.     s->bit_left=32;
  77.     s->bit_buf=0;

libavcodec/put_bits.h:76:5: 
  74. #else
  75.     s->buf_ptr = s->buf;
  76.     s->bit_left=32;
          ^
  77.     s->bit_buf=0;
  78. #endif

libavcodec/put_bits.h:77:5: 
  75.     s->buf_ptr = s->buf;
  76.     s->bit_left=32;
  77.     s->bit_buf=0;
          ^
  78. #endif
  79. }

libavcodec/put_bits.h:79:1: return from a call to init_put_bits
  77.     s->bit_buf=0;
  78. #endif
  79. }
      ^
  80. 
  81. /**

libavcodec/alacenc.c:482:9: Taking true branch
480.     init_put_bits(pb, frame, buf_size);
481. 
482.     if((s->compression_level == 0) || verbatim_flag) {
             ^
483.         // Verbatim mode
484.         int16_t *samples = data;

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

libavcodec/alacenc.c:485:9: 
483.         // Verbatim mode
484.         int16_t *samples = data;
485.         write_frame_header(s, 1);
             ^
486.         for(i=0; i<avctx->frame_size*avctx->channels; i++) {
487.             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:149:1: start of procedure put_bits()
    147.  * Use put_bits32 to write 32 bits.
    148.  */
    149. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         ^
    150. #ifndef ALT_BITSTREAM_WRITER
    151. {

libavcodec/put_bits.h:156:5: 
    154. 
    155.     //    printf("put_bits=%d %x\n", n, value);
    156.     assert(n <= 31 && value < (1U << n));
             ^
    157. 
    158.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:158:5: 
    156.     assert(n <= 31 && value < (1U << n));
    157. 
    158.     bit_buf = s->bit_buf;
             ^
    159.     bit_left = s->bit_left;
    160. 

libavcodec/put_bits.h:159:5: 
    157. 
    158.     bit_buf = s->bit_buf;
    159.     bit_left = s->bit_left;
             ^
    160. 
    161.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:178:9: Taking false branch
    176.     bit_left-=n;
    177. #else
    178.     if (n < bit_left) {
                 ^
    179.         bit_buf = (bit_buf<<n) | value;
    180.         bit_left-=n;

libavcodec/put_bits.h:182:9: 
    180.         bit_left-=n;
    181.     } else {
    182.         bit_buf<<=bit_left;
                 ^
    183.         bit_buf |= value >> (n - bit_left);
    184. #if !HAVE_FAST_UNALIGNED

libavcodec/put_bits.h:183:9: 
    181.     } else {
    182.         bit_buf<<=bit_left;
    183.         bit_buf |= value >> (n - bit_left);
                 ^
    184. #if !HAVE_FAST_UNALIGNED
    185.         if (3 & (intptr_t) s->buf_ptr) {

libavcodec/put_bits.h:185:13: Taking false branch
    183.         bit_buf |= value >> (n - bit_left);
    184. #if !HAVE_FAST_UNALIGNED
    185.         if (3 & (intptr_t) s->buf_ptr) {
                     ^
    186.             AV_WB32(s->buf_ptr, bit_buf);
    187.         } else

libavcodec/put_bits.h:189:9: 
    187.         } else
    188. #endif
    189.         *(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
                 ^
    190.         //printf("bitbuf = %08x\n", bit_buf);
    191.         s->buf_ptr+=4;

libavutil/bswap.h:60:1: start of procedure bswap_32()
      58. 
      59. #ifndef bswap_32
      60. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
          ^
      61. {
      62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:62:5: 
      60. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
      61. {
      62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
              ^
      63.     x= (x>>16) | (x<<16);
      64.     return x;

libavutil/bswap.h:63:5: 
      61. {
      62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      63.     x= (x>>16) | (x<<16);
              ^
      64.     return x;
      65. }

libavutil/bswap.h:64:5: 
      62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      63.     x= (x>>16) | (x<<16);
      64.     return x;
              ^
      65. }
      66. #endif

libavutil/bswap.h:65:1: return from a call to bswap_32
      63.     x= (x>>16) | (x<<16);
      64.     return x;
      65. }
          ^
      66. #endif
      67. 

libavcodec/put_bits.h:191:9: 
    189.         *(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
    190.         //printf("bitbuf = %08x\n", bit_buf);
    191.         s->buf_ptr+=4;
                 ^
    192.         bit_left+=32 - n;
    193.         bit_buf = value;

libavcodec/put_bits.h:192:9: 
    190.         //printf("bitbuf = %08x\n", bit_buf);
    191.         s->buf_ptr+=4;
    192.         bit_left+=32 - n;
                 ^
    193.         bit_buf = value;
    194.     }

libavcodec/put_bits.h:193:9: 
    191.         s->buf_ptr+=4;
    192.         bit_left+=32 - n;
    193.         bit_buf = value;
                 ^
    194.     }
    195. #endif

libavcodec/put_bits.h:197:5: 
    195. #endif
    196. 
    197.     s->bit_buf = bit_buf;
             ^
    198.     s->bit_left = bit_left;
    199. }

libavcodec/put_bits.h:198:5: 
    196. 
    197.     s->bit_buf = bit_buf;
    198.     s->bit_left = bit_left;
             ^
    199. }
    200. #else  /* ALT_BITSTREAM_WRITER defined */

libavcodec/put_bits.h:199:1: return from a call to put_bits
    197.     s->bit_buf = bit_buf;
    198.     s->bit_left = bit_left;
    199. }
         ^
    200. #else  /* ALT_BITSTREAM_WRITER defined */
    201. {

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:149:1: start of procedure put_bits()
    147.  * Use put_bits32 to write 32 bits.
    148.  */
    149. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         ^
    150. #ifndef ALT_BITSTREAM_WRITER
    151. {

libavcodec/put_bits.h:156:5: 
    154. 
    155.     //    printf("put_bits=%d %x\n", n, value);
    156.     assert(n <= 31 && value < (1U << n));
             ^
    157. 
    158.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:158:5: 
    156.     assert(n <= 31 && value < (1U << n));
    157. 
    158.     bit_buf = s->bit_buf;
             ^
    159.     bit_left = s->bit_left;
    160. 

libavcodec/put_bits.h:159:5: 
    157. 
    158.     bit_buf = s->bit_buf;
    159.     bit_left = s->bit_left;
             ^
    160. 
    161.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:178:9: Taking true branch
    176.     bit_left-=n;
    177. #else
    178.     if (n < bit_left) {
                 ^
    179.         bit_buf = (bit_buf<<n) | value;
    180.         bit_left-=n;

libavcodec/put_bits.h:179:9: 
    177. #else
    178.     if (n < bit_left) {
    179.         bit_buf = (bit_buf<<n) | value;
                 ^
    180.         bit_left-=n;
    181.     } else {

libavcodec/put_bits.h:180:9: 
    178.     if (n < bit_left) {
    179.         bit_buf = (bit_buf<<n) | value;
    180.         bit_left-=n;
                 ^
    181.     } else {
    182.         bit_buf<<=bit_left;

libavcodec/put_bits.h:197:5: 
    195. #endif
    196. 
    197.     s->bit_buf = bit_buf;
             ^
    198.     s->bit_left = bit_left;
    199. }

libavcodec/put_bits.h:198:5: 
    196. 
    197.     s->bit_buf = bit_buf;
    198.     s->bit_left = bit_left;
             ^
    199. }
    200. #else  /* ALT_BITSTREAM_WRITER defined */

libavcodec/put_bits.h:199:1: return from a call to put_bits
    197.     s->bit_buf = bit_buf;
    198.     s->bit_left = bit_left;
    199. }
         ^
    200. #else  /* ALT_BITSTREAM_WRITER defined */
    201. {

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:149:1: start of procedure put_bits()
    147.  * Use put_bits32 to write 32 bits.
    148.  */
    149. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         ^
    150. #ifndef ALT_BITSTREAM_WRITER
    151. {

libavcodec/put_bits.h:156:5: 
    154. 
    155.     //    printf("put_bits=%d %x\n", n, value);
    156.     assert(n <= 31 && value < (1U << n));
             ^
    157. 
    158.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:158:5: 
    156.     assert(n <= 31 && value < (1U << n));
    157. 
    158.     bit_buf = s->bit_buf;
             ^
    159.     bit_left = s->bit_left;
    160. 

libavcodec/put_bits.h:159:5: 
    157. 
    158.     bit_buf = s->bit_buf;
    159.     bit_left = s->bit_left;
             ^
    160. 
    161.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:178:9: Taking true branch
    176.     bit_left-=n;
    177. #else
    178.     if (n < bit_left) {
                 ^
    179.         bit_buf = (bit_buf<<n) | value;
    180.         bit_left-=n;

libavcodec/put_bits.h:179:9: 
    177. #else
    178.     if (n < bit_left) {
    179.         bit_buf = (bit_buf<<n) | value;
                 ^
    180.         bit_left-=n;
    181.     } else {

libavcodec/put_bits.h:180:9: 
    178.     if (n < bit_left) {
    179.         bit_buf = (bit_buf<<n) | value;
    180.         bit_left-=n;
                 ^
    181.     } else {
    182.         bit_buf<<=bit_left;

libavcodec/put_bits.h:197:5: 
    195. #endif
    196. 
    197.     s->bit_buf = bit_buf;
             ^
    198.     s->bit_left = bit_left;
    199. }

libavcodec/put_bits.h:198:5: 
    196. 
    197.     s->bit_buf = bit_buf;
    198.     s->bit_left = bit_left;
             ^
    199. }
    200. #else  /* ALT_BITSTREAM_WRITER defined */

libavcodec/put_bits.h:199:1: return from a call to put_bits
    197.     s->bit_buf = bit_buf;
    198.     s->bit_left = bit_left;
    199. }
         ^
    200. #else  /* ALT_BITSTREAM_WRITER defined */
    201. {

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:149:1: start of procedure put_bits()
    147.  * Use put_bits32 to write 32 bits.
    148.  */
    149. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         ^
    150. #ifndef ALT_BITSTREAM_WRITER
    151. {

libavcodec/put_bits.h:156:5: 
    154. 
    155.     //    printf("put_bits=%d %x\n", n, value);
    156.     assert(n <= 31 && value < (1U << n));
             ^
    157. 
    158.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:158:5: 
    156.     assert(n <= 31 && value < (1U << n));
    157. 
    158.     bit_buf = s->bit_buf;
             ^
    159.     bit_left = s->bit_left;
    160. 

libavcodec/put_bits.h:159:5: 
    157. 
    158.     bit_buf = s->bit_buf;
    159.     bit_left = s->bit_left;
             ^
    160. 
    161.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:178:9: Taking true branch
    176.     bit_left-=n;
    177. #else
    178.     if (n < bit_left) {
                 ^
    179.         bit_buf = (bit_buf<<n) | value;
    180.         bit_left-=n;

libavcodec/put_bits.h:179:9: 
    177. #else
    178.     if (n < bit_left) {
    179.         bit_buf = (bit_buf<<n) | value;
                 ^
    180.         bit_left-=n;
    181.     } else {

libavcodec/put_bits.h:180:9: 
    178.     if (n < bit_left) {
    179.         bit_buf = (bit_buf<<n) | value;
    180.         bit_left-=n;
                 ^
    181.     } else {
    182.         bit_buf<<=bit_left;

libavcodec/put_bits.h:197:5: 
    195. #endif
    196. 
    197.     s->bit_buf = bit_buf;
             ^
    198.     s->bit_left = bit_left;
    199. }

libavcodec/put_bits.h:198:5: 
    196. 
    197.     s->bit_buf = bit_buf;
    198.     s->bit_left = bit_left;
             ^
    199. }
    200. #else  /* ALT_BITSTREAM_WRITER defined */

libavcodec/put_bits.h:199:1: return from a call to put_bits
    197.     s->bit_buf = bit_buf;
    198.     s->bit_left = bit_left;
    199. }
         ^
    200. #else  /* ALT_BITSTREAM_WRITER defined */
    201. {

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:149:1: start of procedure put_bits()
    147.  * Use put_bits32 to write 32 bits.
    148.  */
    149. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         ^
    150. #ifndef ALT_BITSTREAM_WRITER
    151. {

libavcodec/put_bits.h:156:5: 
    154. 
    155.     //    printf("put_bits=%d %x\n", n, value);
    156.     assert(n <= 31 && value < (1U << n));
             ^
    157. 
    158.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:158:5: 
    156.     assert(n <= 31 && value < (1U << n));
    157. 
    158.     bit_buf = s->bit_buf;
             ^
    159.     bit_left = s->bit_left;
    160. 

libavcodec/put_bits.h:159:5: 
    157. 
    158.     bit_buf = s->bit_buf;
    159.     bit_left = s->bit_left;
             ^
    160. 
    161.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:178:9: Taking true branch
    176.     bit_left-=n;
    177. #else
    178.     if (n < bit_left) {
                 ^
    179.         bit_buf = (bit_buf<<n) | value;
    180.         bit_left-=n;

libavcodec/put_bits.h:179:9: 
    177. #else
    178.     if (n < bit_left) {
    179.         bit_buf = (bit_buf<<n) | value;
                 ^
    180.         bit_left-=n;
    181.     } else {

libavcodec/put_bits.h:180:9: 
    178.     if (n < bit_left) {
    179.         bit_buf = (bit_buf<<n) | value;
    180.         bit_left-=n;
                 ^
    181.     } else {
    182.         bit_buf<<=bit_left;

libavcodec/put_bits.h:197:5: 
    195. #endif
    196. 
    197.     s->bit_buf = bit_buf;
             ^
    198.     s->bit_left = bit_left;
    199. }

libavcodec/put_bits.h:198:5: 
    196. 
    197.     s->bit_buf = bit_buf;
    198.     s->bit_left = bit_left;
             ^
    199. }
    200. #else  /* ALT_BITSTREAM_WRITER defined */

libavcodec/put_bits.h:199:1: return from a call to put_bits
    197.     s->bit_buf = bit_buf;
    198.     s->bit_left = bit_left;
    199. }
         ^
    200. #else  /* ALT_BITSTREAM_WRITER defined */
    201. {

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:275:1: start of procedure put_bits32()
    273.  * Write exactly 32 bits into a bitstream.
    274.  */
    275. static void av_unused put_bits32(PutBitContext *s, uint32_t value)
         ^
    276. {
    277.     int lo = value & 0xffff;

libavcodec/put_bits.h:277:5: 
    275. static void av_unused put_bits32(PutBitContext *s, uint32_t value)
    276. {
    277.     int lo = value & 0xffff;
             ^
    278.     int hi = value >> 16;
    279. #ifdef BITSTREAM_WRITER_LE

libavcodec/put_bits.h:278:5: 
    276. {
    277.     int lo = value & 0xffff;
    278.     int hi = value >> 16;
             ^
    279. #ifdef BITSTREAM_WRITER_LE
    280.     put_bits(s, 16, lo);

libavcodec/put_bits.h:280:5: 
    278.     int hi = value >> 16;
    279. #ifdef BITSTREAM_WRITER_LE
    280.     put_bits(s, 16, lo);
             ^
    281.     put_bits(s, 16, hi);
    282. #else

libavcodec/put_bits.h:149:1: start of procedure put_bits()
      147.  * Use put_bits32 to write 32 bits.
      148.  */
      149. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
           ^
      150. #ifndef ALT_BITSTREAM_WRITER
      151. {

libavcodec/put_bits.h:156:5: 
      154. 
      155.     //    printf("put_bits=%d %x\n", n, value);
      156.     assert(n <= 31 && value < (1U << n));
               ^
      157. 
      158.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:158:5: 
      156.     assert(n <= 31 && value < (1U << n));
      157. 
      158.     bit_buf = s->bit_buf;
               ^
      159.     bit_left = s->bit_left;
      160. 

libavcodec/put_bits.h:159:5: 
      157. 
      158.     bit_buf = s->bit_buf;
      159.     bit_left = s->bit_left;
               ^
      160. 
      161.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:178:9: Taking true branch
      176.     bit_left-=n;
      177. #else
      178.     if (n < bit_left) {
                   ^
      179.         bit_buf = (bit_buf<<n) | value;
      180.         bit_left-=n;

libavcodec/put_bits.h:179:9: 
      177. #else
      178.     if (n < bit_left) {
      179.         bit_buf = (bit_buf<<n) | value;
                   ^
      180.         bit_left-=n;
      181.     } else {

libavcodec/put_bits.h:180:9: 
      178.     if (n < bit_left) {
      179.         bit_buf = (bit_buf<<n) | value;
      180.         bit_left-=n;
                   ^
      181.     } else {
      182.         bit_buf<<=bit_left;

libavcodec/put_bits.h:197:5: 
      195. #endif
      196. 
      197.     s->bit_buf = bit_buf;
               ^
      198.     s->bit_left = bit_left;
      199. }

libavcodec/put_bits.h:198:5: 
      196. 
      197.     s->bit_buf = bit_buf;
      198.     s->bit_left = bit_left;
               ^
      199. }
      200. #else  /* ALT_BITSTREAM_WRITER defined */

libavcodec/put_bits.h:199:1: return from a call to put_bits
      197.     s->bit_buf = bit_buf;
      198.     s->bit_left = bit_left;
      199. }
           ^
      200. #else  /* ALT_BITSTREAM_WRITER defined */
      201. {

libavcodec/put_bits.h:281:5: 
    279. #ifdef BITSTREAM_WRITER_LE
    280.     put_bits(s, 16, lo);
    281.     put_bits(s, 16, hi);
             ^
    282. #else
    283.     put_bits(s, 16, hi);

libavcodec/put_bits.h:149:1: start of procedure put_bits()
      147.  * Use put_bits32 to write 32 bits.
      148.  */
      149. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
           ^
      150. #ifndef ALT_BITSTREAM_WRITER
      151. {

libavcodec/put_bits.h:156:5: 
      154. 
      155.     //    printf("put_bits=%d %x\n", n, value);
      156.     assert(n <= 31 && value < (1U << n));
               ^
      157. 
      158.     bit_buf = s->bit_buf;

libavcodec/put_bits.h:158:5: 
      156.     assert(n <= 31 && value < (1U << n));
      157. 
      158.     bit_buf = s->bit_buf;
               ^
      159.     bit_left = s->bit_left;
      160. 

libavcodec/put_bits.h:159:5: 
      157. 
      158.     bit_buf = s->bit_buf;
      159.     bit_left = s->bit_left;
               ^
      160. 
      161.     //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);

libavcodec/put_bits.h:178:9: Taking false branch
      176.     bit_left-=n;
      177. #else
      178.     if (n < bit_left) {
                   ^
      179.         bit_buf = (bit_buf<<n) | value;
      180.         bit_left-=n;

libavcodec/put_bits.h:182:9: 
      180.         bit_left-=n;
      181.     } else {
      182.         bit_buf<<=bit_left;
                   ^
      183.         bit_buf |= value >> (n - bit_left);
      184. #if !HAVE_FAST_UNALIGNED

libavcodec/put_bits.h:183:9: 
      181.     } else {
      182.         bit_buf<<=bit_left;
      183.         bit_buf |= value >> (n - bit_left);
                   ^
      184. #if !HAVE_FAST_UNALIGNED
      185.         if (3 & (intptr_t) s->buf_ptr) {

libavcodec/put_bits.h:185:13: Taking false branch
      183.         bit_buf |= value >> (n - bit_left);
      184. #if !HAVE_FAST_UNALIGNED
      185.         if (3 & (intptr_t) s->buf_ptr) {
                       ^
      186.             AV_WB32(s->buf_ptr, bit_buf);
      187.         } else

libavcodec/put_bits.h:189:9: 
      187.         } else
      188. #endif
      189.         *(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
                   ^
      190.         //printf("bitbuf = %08x\n", bit_buf);
      191.         s->buf_ptr+=4;

libavutil/bswap.h:60:1: start of procedure bswap_32()
        58. 
        59. #ifndef bswap_32
        60. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
            ^
        61. {
        62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:62:5: 
        60. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
        61. {
        62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
                ^
        63.     x= (x>>16) | (x<<16);
        64.     return x;

libavutil/bswap.h:63:5: 
        61. {
        62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
        63.     x= (x>>16) | (x<<16);
                ^
        64.     return x;
        65. }

libavutil/bswap.h:64:5: 
        62.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
        63.     x= (x>>16) | (x<<16);
        64.     return x;
                ^
        65. }
        66. #endif

libavutil/bswap.h:65:1: return from a call to bswap_32
        63.     x= (x>>16) | (x<<16);
        64.     return x;
        65. }
            ^
        66. #endif
        67. 

libavcodec/put_bits.h:191:9: 
      189.         *(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
      190.         //printf("bitbuf = %08x\n", bit_buf);
      191.         s->buf_ptr+=4;
                   ^
      192.         bit_left+=32 - n;
      193.         bit_buf = value;

libavcodec/put_bits.h:192:9: 
      190.         //printf("bitbuf = %08x\n", bit_buf);
      191.         s->buf_ptr+=4;
      192.         bit_left+=32 - n;
                   ^
      193.         bit_buf = value;
      194.     }

libavcodec/put_bits.h:193:9: 
      191.         s->buf_ptr+=4;
      192.         bit_left+=32 - n;
      193.         bit_buf = value;
                   ^
      194.     }
      195. #endif

libavcodec/put_bits.h:197:5: 
      195. #endif
      196. 
      197.     s->bit_buf = bit_buf;
               ^
      198.     s->bit_left = bit_left;
      199. }

libavcodec/put_bits.h:198:5: 
      196. 
      197.     s->bit_buf = bit_buf;
      198.     s->bit_left = bit_left;
               ^
      199. }
      200. #else  /* ALT_BITSTREAM_WRITER defined */

libavcodec/put_bits.h:199:1: return from a call to put_bits
      197.     s->bit_buf = bit_buf;
      198.     s->bit_left = bit_left;
      199. }
           ^
      200. #else  /* ALT_BITSTREAM_WRITER defined */
      201. {

libavcodec/put_bits.h:286:1: return from a call to put_bits32
    284.     put_bits(s, 16, lo);
    285. #endif
    286. }
         ^
    287. 
    288. /**

libavcodec/alacenc.c:126:1: return from a call to write_frame_header
  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. 
  128. static void calc_predictor_params(AlacEncodeContext *s, int ch)

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) {
        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        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#ifdef ALT_BITSTREAM_WRITER\n    s->index=0;\n    ((uint32_t*)(s->buf))[0]=0;\n#else\n    s->buf_ptr = s->buf;\n    s->bit_left=32;\n    s->bit_buf=0;\n#endif\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#ifndef ALT_BITSTREAM_WRITER\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#if !HAVE_FAST_UNALIGNED\n        if (3 & (intptr_t) s->buf_ptr) {\n            AV_WL32(s->buf_ptr, bit_buf);\n        } else\n#endif\n        *(uint32_t *)s->buf_ptr = le2me_32(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#if !HAVE_FAST_UNALIGNED\n        if (3 & (intptr_t) s->buf_ptr) {\n            AV_WB32(s->buf_ptr, bit_buf);\n        } else\n#endif\n        *(uint32_t *)s->buf_ptr = be2me_32(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 bswap_32(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}']