libavcodec/movsub_bsf.c:49: error: Null Dereference
  pointer `*poutbuf` last assigned on line 48 could be null and is dereferenced by call to `memcpy()` at line 49, column 5.

libavcodec/movsub_bsf.c:43:1: start of procedure mov2textsub()
41. };
42. 
43. static int mov2textsub(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
    ^
44.                      uint8_t **poutbuf, int *poutbuf_size,
45.                      const uint8_t *buf, int buf_size, int keyframe){

libavcodec/movsub_bsf.c:46:9: Taking false branch
44.                      uint8_t **poutbuf, int *poutbuf_size,
45.                      const uint8_t *buf, int buf_size, int keyframe){
46.     if (buf_size < 2) return 0;
            ^
47.     *poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
48.     *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);

libavcodec/movsub_bsf.c:47:21: 
45.                      const uint8_t *buf, int buf_size, int keyframe){
46.     if (buf_size < 2) return 0;
47.     *poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
                        ^
48.     *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
49.     memcpy(*poutbuf, buf + 2, *poutbuf_size);

libavutil/ppc/intreadwrite.h:61:1: start of procedure av_read_bswap16()
  59. #endif
  60. 
  61. static av_always_inline uint16_t av_read_bswap16(const void *p)
      ^
  62. {
  63.     uint16_t v;

libavutil/ppc/intreadwrite.h:64:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
  62. {
  63.     uint16_t v;
  64.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
          ^
  65.     return v;
  66. }

libavutil/ppc/intreadwrite.h:65:5: 
  63.     uint16_t v;
  64.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
  65.     return v;
          ^
  66. }
  67. 

libavutil/ppc/intreadwrite.h:66:1: return from a call to av_read_bswap16
  64.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
  65.     return v;
  66. }
      ^
  67. 
  68. static av_always_inline void av_write_bswap16(void *p, uint16_t v)

libavcodec/movsub_bsf.c:47:21: Condition is true
45.                      const uint8_t *buf, int buf_size, int keyframe){
46.     if (buf_size < 2) return 0;
47.     *poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
                        ^
48.     *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
49.     memcpy(*poutbuf, buf + 2, *poutbuf_size);

libavutil/ppc/intreadwrite.h:61:1: start of procedure av_read_bswap16()
  59. #endif
  60. 
  61. static av_always_inline uint16_t av_read_bswap16(const void *p)
      ^
  62. {
  63.     uint16_t v;

libavutil/ppc/intreadwrite.h:64:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
  62. {
  63.     uint16_t v;
  64.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
          ^
  65.     return v;
  66. }

libavutil/ppc/intreadwrite.h:65:5: 
  63.     uint16_t v;
  64.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
  65.     return v;
          ^
  66. }
  67. 

libavutil/ppc/intreadwrite.h:66:1: return from a call to av_read_bswap16
  64.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
  65.     return v;
  66. }
      ^
  67. 
  68. static av_always_inline void av_write_bswap16(void *p, uint16_t v)

libavcodec/movsub_bsf.c:47:5: 
45.                      const uint8_t *buf, int buf_size, int keyframe){
46.     if (buf_size < 2) return 0;
47.     *poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
        ^
48.     *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
49.     memcpy(*poutbuf, buf + 2, *poutbuf_size);

libavcodec/movsub_bsf.c:48:5: 
46.     if (buf_size < 2) return 0;
47.     *poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
48.     *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
        ^
49.     memcpy(*poutbuf, buf + 2, *poutbuf_size);
50.     return 1;

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

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

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

libavutil/mem.c:71:9: 
  69.     /* let's disallow possibly ambiguous cases */
  70.     if (size > (INT_MAX - 32) || !size)
  71.         return NULL;
              ^
  72. 
  73. #if CONFIG_MEMALIGN_HACK

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

libavcodec/movsub_bsf.c:49:5: 
47.     *poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
48.     *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
49.     memcpy(*poutbuf, buf + 2, *poutbuf_size);
        ^
50.     return 1;
51. }
