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

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

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

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

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

libavutil/mem.c:47:1: start of procedure av_malloc()
  45.    linker will do it automatically. */
  46. 
  47. void *av_malloc(unsigned int size)
      ^
  48. {
  49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
  47. void *av_malloc(unsigned int size)
  48. {
  49.     void *ptr = NULL;
          ^
  50. #if CONFIG_MEMALIGN_HACK
  51.     long diff;

libavutil/mem.c:55:8: Taking false branch
  53. 
  54.     /* let's disallow possible ambiguous cases */
  55.     if(size > (INT_MAX-16) )
             ^
  56.         return NULL;
  57. 

libavutil/mem.c:66:9: Taking true branch
  64.     ((char*)ptr)[-1]= diff;
  65. #elif HAVE_POSIX_MEMALIGN
  66.     if (posix_memalign(&ptr,16,size))
              ^
  67.         ptr = NULL;
  68. #elif HAVE_MEMALIGN

libavutil/mem.c:67:9: 
  65. #elif HAVE_POSIX_MEMALIGN
  66.     if (posix_memalign(&ptr,16,size))
  67.         ptr = NULL;
              ^
  68. #elif HAVE_MEMALIGN
  69.     ptr = memalign(16,size);

libavutil/mem.c:99:5: 
   97.     ptr = malloc(size);
   98. #endif
   99.     return ptr;
           ^
  100. }
  101. 

libavutil/mem.c:100:1: return from a call to av_malloc
   98. #endif
   99.     return ptr;
  100. }
       ^
  101. 
  102. void *av_realloc(void *ptr, unsigned int size)

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

libavutil/bswap.h:44:1: start of procedure bswap_16()
  42. 
  43. #ifndef bswap_16
  44. static av_always_inline av_const uint16_t bswap_16(uint16_t x)
      ^
  45. {
  46.     x= (x>>8) | (x<<8);

libavutil/bswap.h:46:5: 
  44. static av_always_inline av_const uint16_t bswap_16(uint16_t x)
  45. {
  46.     x= (x>>8) | (x<<8);
          ^
  47.     return x;
  48. }

libavutil/bswap.h:47:5: 
  45. {
  46.     x= (x>>8) | (x<<8);
  47.     return x;
          ^
  48. }
  49. #endif

libavutil/bswap.h:48:1: return from a call to bswap_16
  46.     x= (x>>8) | (x<<8);
  47.     return x;
  48. }
      ^
  49. #endif
  50. 
