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:30:1: start of procedure AV_RL16()
  28. 
  29. #define AV_RL16 AV_RL16
  30. static av_always_inline uint16_t AV_RL16(const void *p)
      ^
  31. {
  32.     uint16_t v;

libavutil/ppc/intreadwrite.h:33:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
  31. {
  32.     uint16_t v;
  33.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
          ^
  34.     return v;
  35. }

libavutil/ppc/intreadwrite.h:34:5: 
  32.     uint16_t v;
  33.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
  34.     return v;
          ^
  35. }
  36. 

libavutil/ppc/intreadwrite.h:35:1: return from a call to AV_RL16
  33.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
  34.     return v;
  35. }
      ^
  36. 
  37. #define AV_WL16 AV_WL16

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. 

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:30:1: start of procedure AV_RL16()
  28. 
  29. #define AV_RL16 AV_RL16
  30. static av_always_inline uint16_t AV_RL16(const void *p)
      ^
  31. {
  32.     uint16_t v;

libavutil/ppc/intreadwrite.h:33:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
  31. {
  32.     uint16_t v;
  33.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
          ^
  34.     return v;
  35. }

libavutil/ppc/intreadwrite.h:34:5: 
  32.     uint16_t v;
  33.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
  34.     return v;
          ^
  35. }
  36. 

libavutil/ppc/intreadwrite.h:35:1: return from a call to AV_RL16
  33.     __asm__ ("lhbrx   %0, %y1" : "=r"(v) : "Z"(*(const uint16_t*)p));
  34.     return v;
  35. }
      ^
  36. 
  37. #define AV_WL16 AV_WL16

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. 

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:61:1: start of procedure av_malloc()
  59.  * linker will do it automatically. */
  60. 
  61. void *av_malloc(size_t size)
      ^
  62. {
  63.     void *ptr = NULL;

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

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

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

libavutil/mem.c:114:1: return from a call to av_malloc
  112. #endif
  113.     return ptr;
  114. }
       ^
  115. 
  116. 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. }

static int mov2textsub(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
                     uint8_t **poutbuf, int *poutbuf_size,
                     const uint8_t *buf, int buf_size, int keyframe){
    if (buf_size < 2) return 0;
    *poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
    *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
    memcpy(*poutbuf, buf + 2, *poutbuf_size);
    return 1;
}
['static int mov2textsub(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,\n                     uint8_t **poutbuf, int *poutbuf_size,\n                     const uint8_t *buf, int buf_size, int keyframe){\n    if (buf_size < 2) return 0;\n    *poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));\n    *poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);\n    memcpy(*poutbuf, buf + 2, *poutbuf_size);\n    return 1;\n}', 'static av_always_inline av_const uint16_t av_bswap16(uint16_t x)\n{\n    x= (x>>8) | (x<<8);\n    return x;\n}', 'void *av_malloc(size_t size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if (size > (INT_MAX - 32) || !size)\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size + 32);\n    if (!ptr)\n        return ptr;\n    diff              = ((-(long)ptr - 1) & 31) + 1;\n    ptr               = (char *)ptr + diff;\n    ((char *)ptr)[-1] = diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr, 32, size))\n        ptr = NULL;\n#elif HAVE_ALIGNED_MALLOC\n    ptr = _aligned_malloc(size, 32);\n#elif HAVE_MEMALIGN\n    ptr = memalign(32, size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']