libavcodec/movsub_bsf.c:32: error: Null Dereference
  pointer `*poutbuf` last assigned on line 31 could be null and is dereferenced at line 32, column 5.

libavcodec/movsub_bsf.c:26:1: start of procedure text2movsub()
24. 
25. 
26. static int text2movsub(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
    ^
27.                      uint8_t **poutbuf, int *poutbuf_size,
28.                      const uint8_t *buf, int buf_size, int keyframe){

libavcodec/movsub_bsf.c:29:9: Taking false branch
27.                      uint8_t **poutbuf, int *poutbuf_size,
28.                      const uint8_t *buf, int buf_size, int keyframe){
29.     if (buf_size > 0xffff) return 0;
            ^
30.     *poutbuf_size = buf_size + 2;
31.     *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);

libavcodec/movsub_bsf.c:30:5: 
28.                      const uint8_t *buf, int buf_size, int keyframe){
29.     if (buf_size > 0xffff) return 0;
30.     *poutbuf_size = buf_size + 2;
        ^
31.     *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
32.     AV_WB16(*poutbuf, buf_size);

libavcodec/movsub_bsf.c:31:5: 
29.     if (buf_size > 0xffff) return 0;
30.     *poutbuf_size = buf_size + 2;
31.     *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
        ^
32.     AV_WB16(*poutbuf, buf_size);
33.     memcpy(*poutbuf + 2, buf, buf_size);

libavutil/mem.c:64:1: start of procedure av_malloc()
  62.  * linker will do it automatically. */
  63. 
  64. void *av_malloc(size_t size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(size_t size)
  65. {
  66.     void *ptr = NULL;
          ^
  67. #if CONFIG_MEMALIGN_HACK
  68.     long diff;

libavutil/mem.c:72:9: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX - 32) || !size)
              ^
  73.         return NULL;
  74. 

libavutil/mem.c:72:35: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX - 32) || !size)
                                        ^
  73.         return NULL;
  74. 

libavutil/mem.c:83:9: Taking true branch
  81.     ((char *)ptr)[-1] = diff;
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr, 32, size))
              ^
  84.         ptr = NULL;
  85. #elif HAVE_ALIGNED_MALLOC

libavutil/mem.c:84:9: 
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr, 32, size))
  84.         ptr = NULL;
              ^
  85. #elif HAVE_ALIGNED_MALLOC
  86.     ptr = _aligned_malloc(size, 32);

libavutil/mem.c:116:5: 
  114.     ptr = malloc(size);
  115. #endif
  116.     return ptr;
           ^
  117. }
  118. 

libavutil/mem.c:117:1: return from a call to av_malloc
  115. #endif
  116.     return ptr;
  117. }
       ^
  118. 
  119. void *av_realloc(void *ptr, size_t size)

libavcodec/movsub_bsf.c:32:5: 
30.     *poutbuf_size = buf_size + 2;
31.     *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
32.     AV_WB16(*poutbuf, buf_size);
        ^
33.     memcpy(*poutbuf + 2, buf, buf_size);
34.     return 1;

libavutil/bswap.h:58:1: start of procedure av_bswap16()
  56. 
  57. #ifndef av_bswap16
  58. static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
      ^
  59. {
  60.     x= (x>>8) | (x<<8);

libavutil/bswap.h:60:5: 
  58. static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
  59. {
  60.     x= (x>>8) | (x<<8);
          ^
  61.     return x;
  62. }

libavutil/bswap.h:61:5: 
  59. {
  60.     x= (x>>8) | (x<<8);
  61.     return x;
          ^
  62. }
  63. #endif

libavutil/bswap.h:62:1: return from a call to av_bswap16
  60.     x= (x>>8) | (x<<8);
  61.     return x;
  62. }
      ^
  63. #endif
  64. 
