libavcodec/h264_mp4toannexb_bsf.c:92: error: Memory Leak
  memory dynamically allocated by call to `av_realloc()` at line 92, column 19 is not reachable after line 92, column 13.

libavcodec/h264_mp4toannexb_bsf.c:50:1: start of procedure h264_mp4toannexb_filter()
48. }
49. 
50. static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
    ^
51.                                    AVCodecContext *avctx, const char *args,
52.                                    uint8_t  **poutbuf, int *poutbuf_size,

libavcodec/h264_mp4toannexb_bsf.c:55:5: 
53.                                    const uint8_t *buf, int      buf_size,
54.                                    int keyframe) {
55.     H264BSFContext *ctx = bsfc->priv_data;
        ^
56.     uint8_t unit_type;
57.     uint32_t nal_size, cumul_size = 0;

libavcodec/h264_mp4toannexb_bsf.c:57:5: 
55.     H264BSFContext *ctx = bsfc->priv_data;
56.     uint8_t unit_type;
57.     uint32_t nal_size, cumul_size = 0;
        ^
58. 
59.     /* nothing to filter */

libavcodec/h264_mp4toannexb_bsf.c:60:10: Taking false branch
58. 
59.     /* nothing to filter */
60.     if (!avctx->extradata || avctx->extradata_size < 6) {
             ^
61.         *poutbuf = (uint8_t*) buf;
62.         *poutbuf_size = buf_size;

libavcodec/h264_mp4toannexb_bsf.c:60:30: Taking false branch
58. 
59.     /* nothing to filter */
60.     if (!avctx->extradata || avctx->extradata_size < 6) {
                                 ^
61.         *poutbuf = (uint8_t*) buf;
62.         *poutbuf_size = buf_size;

libavcodec/h264_mp4toannexb_bsf.c:67:10: Taking true branch
65. 
66.     /* retrieve sps and pps NAL units from extradata */
67.     if (!ctx->sps_pps_data) {
             ^
68.         uint16_t unit_size;
69.         uint32_t total_size = 0;

libavcodec/h264_mp4toannexb_bsf.c:69:9: 
67.     if (!ctx->sps_pps_data) {
68.         uint16_t unit_size;
69.         uint32_t total_size = 0;
            ^
70.         uint8_t *out = NULL, unit_nb, sps_done = 0;
71.         const uint8_t *extradata = avctx->extradata+4;

libavcodec/h264_mp4toannexb_bsf.c:70:9: 
68.         uint16_t unit_size;
69.         uint32_t total_size = 0;
70.         uint8_t *out = NULL, unit_nb, sps_done = 0;
            ^
71.         const uint8_t *extradata = avctx->extradata+4;
72.         static const uint8_t nalu_header[4] = {0, 0, 0, 1};

libavcodec/h264_mp4toannexb_bsf.c:71:9: 
69.         uint32_t total_size = 0;
70.         uint8_t *out = NULL, unit_nb, sps_done = 0;
71.         const uint8_t *extradata = avctx->extradata+4;
            ^
72.         static const uint8_t nalu_header[4] = {0, 0, 0, 1};
73. 

libavcodec/h264_mp4toannexb_bsf.c:72:9: 
70.         uint8_t *out = NULL, unit_nb, sps_done = 0;
71.         const uint8_t *extradata = avctx->extradata+4;
72.         static const uint8_t nalu_header[4] = {0, 0, 0, 1};
            ^
73. 
74.         /* retrieve length coded size */

libavcodec/h264_mp4toannexb_bsf.c:75:9: 
73. 
74.         /* retrieve length coded size */
75.         ctx->length_size = (*extradata++ & 0x3) + 1;
            ^
76.         if (ctx->length_size == 3)
77.             return AVERROR(EINVAL);

libavcodec/h264_mp4toannexb_bsf.c:76:13: Taking false branch
74.         /* retrieve length coded size */
75.         ctx->length_size = (*extradata++ & 0x3) + 1;
76.         if (ctx->length_size == 3)
                ^
77.             return AVERROR(EINVAL);
78. 

libavcodec/h264_mp4toannexb_bsf.c:80:9: 
78. 
79.         /* retrieve sps and pps unit(s) */
80.         unit_nb = *extradata++ & 0x1f; /* number of sps unit(s) */
            ^
81.         if (!unit_nb) {
82.             unit_nb = *extradata++; /* number of pps unit(s) */

libavcodec/h264_mp4toannexb_bsf.c:81:14: Taking false branch
79.         /* retrieve sps and pps unit(s) */
80.         unit_nb = *extradata++ & 0x1f; /* number of sps unit(s) */
81.         if (!unit_nb) {
                 ^
82.             unit_nb = *extradata++; /* number of pps unit(s) */
83.             sps_done++;

libavcodec/h264_mp4toannexb_bsf.c:85:16: Loop condition is true. Entering loop body
83.             sps_done++;
84.         }
85.         while (unit_nb--) {
                   ^
86.             unit_size = AV_RB16(extradata);
87.             total_size += unit_size+4;

libavcodec/h264_mp4toannexb_bsf.c:86:13: 
84.         }
85.         while (unit_nb--) {
86.             unit_size = AV_RB16(extradata);
                ^
87.             total_size += unit_size+4;
88.             if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) {

libavcodec/h264_mp4toannexb_bsf.c:87:13: 
85.         while (unit_nb--) {
86.             unit_size = AV_RB16(extradata);
87.             total_size += unit_size+4;
                ^
88.             if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) {
89.                 av_free(out);

libavcodec/h264_mp4toannexb_bsf.c:88:17: Taking false branch
86.             unit_size = AV_RB16(extradata);
87.             total_size += unit_size+4;
88.             if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) {
                    ^
89.                 av_free(out);
90.                 return AVERROR(EINVAL);

libavcodec/h264_mp4toannexb_bsf.c:92:13: 
90.                 return AVERROR(EINVAL);
91.             }
92.             out = av_realloc(out, total_size);
                ^
93.             if (!out)
94.                 return AVERROR(ENOMEM);

libavutil/mem.c:101:1: start of procedure av_realloc()
   99. }
  100. 
  101. void *av_realloc(void *ptr, unsigned int size)
       ^
  102. {
  103. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:108:8: Taking false branch
  106. 
  107.     /* let's disallow possible ambiguous cases */
  108.     if(size > (INT_MAX-16) )
              ^
  109.         return NULL;
  110. 

libavutil/mem.c:117:5: 
  115.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
  116. #else
  117.     return realloc(ptr, size);
           ^
  118. #endif
  119. }

libavutil/mem.c:119:1: return from a call to av_realloc
  117.     return realloc(ptr, size);
  118. #endif
  119. }
       ^
  120. 
  121. void av_free(void *ptr)

libavcodec/h264_mp4toannexb_bsf.c:93:18: Taking false branch
91.             }
92.             out = av_realloc(out, total_size);
93.             if (!out)
                     ^
94.                 return AVERROR(ENOMEM);
95.             memcpy(out+total_size-unit_size-4, nalu_header, 4);

libavcodec/h264_mp4toannexb_bsf.c:95:13: 
93.             if (!out)
94.                 return AVERROR(ENOMEM);
95.             memcpy(out+total_size-unit_size-4, nalu_header, 4);
                ^
96.             memcpy(out+total_size-unit_size,   extradata+2, unit_size);
97.             extradata += 2+unit_size;

libavcodec/h264_mp4toannexb_bsf.c:96:13: 
94.                 return AVERROR(ENOMEM);
95.             memcpy(out+total_size-unit_size-4, nalu_header, 4);
96.             memcpy(out+total_size-unit_size,   extradata+2, unit_size);
                ^
97.             extradata += 2+unit_size;
98. 

libavcodec/h264_mp4toannexb_bsf.c:97:13: 
95.             memcpy(out+total_size-unit_size-4, nalu_header, 4);
96.             memcpy(out+total_size-unit_size,   extradata+2, unit_size);
97.             extradata += 2+unit_size;
                ^
98. 
99.             if (!unit_nb && !sps_done++)

libavcodec/h264_mp4toannexb_bsf.c:99:18: Taking false branch
 97.             extradata += 2+unit_size;
 98. 
 99.             if (!unit_nb && !sps_done++)
                      ^
100.                 unit_nb = *extradata++; /* number of pps unit(s) */
101.         }

libavcodec/h264_mp4toannexb_bsf.c:85:16: Loop condition is true. Entering loop body
83.             sps_done++;
84.         }
85.         while (unit_nb--) {
                   ^
86.             unit_size = AV_RB16(extradata);
87.             total_size += unit_size+4;

libavcodec/h264_mp4toannexb_bsf.c:86:13: 
84.         }
85.         while (unit_nb--) {
86.             unit_size = AV_RB16(extradata);
                ^
87.             total_size += unit_size+4;
88.             if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) {

libavcodec/h264_mp4toannexb_bsf.c:87:13: 
85.         while (unit_nb--) {
86.             unit_size = AV_RB16(extradata);
87.             total_size += unit_size+4;
                ^
88.             if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) {
89.                 av_free(out);

libavcodec/h264_mp4toannexb_bsf.c:88:17: Taking false branch
86.             unit_size = AV_RB16(extradata);
87.             total_size += unit_size+4;
88.             if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) {
                    ^
89.                 av_free(out);
90.                 return AVERROR(EINVAL);

libavcodec/h264_mp4toannexb_bsf.c:92:13: 
90.                 return AVERROR(EINVAL);
91.             }
92.             out = av_realloc(out, total_size);
                ^
93.             if (!out)
94.                 return AVERROR(ENOMEM);

libavutil/mem.c:101:1: start of procedure av_realloc()
   99. }
  100. 
  101. void *av_realloc(void *ptr, unsigned int size)
       ^
  102. {
  103. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:108:8: Taking true branch
  106. 
  107.     /* let's disallow possible ambiguous cases */
  108.     if(size > (INT_MAX-16) )
              ^
  109.         return NULL;
  110. 

libavutil/mem.c:109:9: 
  107.     /* let's disallow possible ambiguous cases */
  108.     if(size > (INT_MAX-16) )
  109.         return NULL;
               ^
  110. 
  111. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:119:1: return from a call to av_realloc
  117.     return realloc(ptr, size);
  118. #endif
  119. }
       ^
  120. 
  121. void av_free(void *ptr)
