libavcodec/indeo3.c:192: error: Null Dereference
  pointer `ctx->planes[p].buffers[1]` last assigned on line 188 could be null and is dereferenced by call to `memset()` at line 192, column 9.

libavcodec/indeo3.c:150:1: start of procedure allocate_frame_buffers()
148. 
149. 
150. static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx,
     ^
151.                                           AVCodecContext *avctx)
152. {

libavcodec/indeo3.c:156:5: 
154.     int luma_pitch, chroma_pitch, luma_size, chroma_size;
155. 
156.     luma_width  = ctx->width;
         ^
157.     luma_height = ctx->height;
158. 

libavcodec/indeo3.c:157:5: 
155. 
156.     luma_width  = ctx->width;
157.     luma_height = ctx->height;
         ^
158. 
159.     if (luma_width  < 16 || luma_width  > 640 ||

libavcodec/indeo3.c:159:9: Taking false branch
157.     luma_height = ctx->height;
158. 
159.     if (luma_width  < 16 || luma_width  > 640 ||
             ^
160.         luma_height < 16 || luma_height > 480 ||
161.         luma_width  &  3 || luma_height &   3) {

libavcodec/indeo3.c:159:29: Taking false branch
157.     luma_height = ctx->height;
158. 
159.     if (luma_width  < 16 || luma_width  > 640 ||
                                 ^
160.         luma_height < 16 || luma_height > 480 ||
161.         luma_width  &  3 || luma_height &   3) {

libavcodec/indeo3.c:160:9: Taking false branch
158. 
159.     if (luma_width  < 16 || luma_width  > 640 ||
160.         luma_height < 16 || luma_height > 480 ||
             ^
161.         luma_width  &  3 || luma_height &   3) {
162.         av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",

libavcodec/indeo3.c:160:29: Taking false branch
158. 
159.     if (luma_width  < 16 || luma_width  > 640 ||
160.         luma_height < 16 || luma_height > 480 ||
                                 ^
161.         luma_width  &  3 || luma_height &   3) {
162.         av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",

libavcodec/indeo3.c:161:9: Taking false branch
159.     if (luma_width  < 16 || luma_width  > 640 ||
160.         luma_height < 16 || luma_height > 480 ||
161.         luma_width  &  3 || luma_height &   3) {
             ^
162.         av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",
163.                luma_width, luma_height);

libavcodec/indeo3.c:161:29: Taking false branch
159.     if (luma_width  < 16 || luma_width  > 640 ||
160.         luma_height < 16 || luma_height > 480 ||
161.         luma_width  &  3 || luma_height &   3) {
                                 ^
162.         av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",
163.                luma_width, luma_height);

libavcodec/indeo3.c:167:5: 
165.     }
166. 
167.     chroma_width  = FFALIGN(luma_width  >> 2, 4);
         ^
168.     chroma_height = FFALIGN(luma_height >> 2, 4);
169. 

libavcodec/indeo3.c:168:5: 
166. 
167.     chroma_width  = FFALIGN(luma_width  >> 2, 4);
168.     chroma_height = FFALIGN(luma_height >> 2, 4);
         ^
169. 
170.     luma_pitch   = FFALIGN(luma_width,   16);

libavcodec/indeo3.c:170:5: 
168.     chroma_height = FFALIGN(luma_height >> 2, 4);
169. 
170.     luma_pitch   = FFALIGN(luma_width,   16);
         ^
171.     chroma_pitch = FFALIGN(chroma_width, 16);
172. 

libavcodec/indeo3.c:171:5: 
169. 
170.     luma_pitch   = FFALIGN(luma_width,   16);
171.     chroma_pitch = FFALIGN(chroma_width, 16);
         ^
172. 
173.     /* Calculate size of the luminance plane.  */

libavcodec/indeo3.c:175:5: 
173.     /* Calculate size of the luminance plane.  */
174.     /* Add one line more for INTRA prediction. */
175.     luma_size = luma_pitch * (luma_height + 1);
         ^
176. 
177.     /* Calculate size of a chrominance planes. */

libavcodec/indeo3.c:179:5: 
177.     /* Calculate size of a chrominance planes. */
178.     /* Add one line more for INTRA prediction. */
179.     chroma_size = chroma_pitch * (chroma_height + 1);
         ^
180. 
181.     /* allocate frame buffers */

libavcodec/indeo3.c:182:10: 
180. 
181.     /* allocate frame buffers */
182.     for (p = 0; p < 3; p++) {
              ^
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;

libavcodec/indeo3.c:182:17: Loop condition is true. Entering loop body
180. 
181.     /* allocate frame buffers */
182.     for (p = 0; p < 3; p++) {
                     ^
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;

libavcodec/indeo3.c:183:34: Condition is true
181.     /* allocate frame buffers */
182.     for (p = 0; p < 3; p++) {
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
                                      ^
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;

libavcodec/indeo3.c:183:33: 
181.     /* allocate frame buffers */
182.     for (p = 0; p < 3; p++) {
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
                                     ^
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;

libavcodec/indeo3.c:183:9: 
181.     /* allocate frame buffers */
182.     for (p = 0; p < 3; p++) {
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
             ^
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;

libavcodec/indeo3.c:184:34: Condition is true
182.     for (p = 0; p < 3; p++) {
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;
                                      ^
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;
186. 

libavcodec/indeo3.c:184:33: 
182.     for (p = 0; p < 3; p++) {
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;
                                     ^
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;
186. 

libavcodec/indeo3.c:184:9: 
182.     for (p = 0; p < 3; p++) {
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;
             ^
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;
186. 

libavcodec/indeo3.c:185:34: Condition is true
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;
                                      ^
186. 
187.         ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);

libavcodec/indeo3.c:185:33: 
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;
                                     ^
186. 
187.         ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);

libavcodec/indeo3.c:185:9: 
183.         ctx->planes[p].pitch  = !p ? luma_pitch  : chroma_pitch;
184.         ctx->planes[p].width  = !p ? luma_width  : chroma_width;
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;
             ^
186. 
187.         ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);

libavcodec/indeo3.c:187:48: Condition is true
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;
186. 
187.         ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
                                                    ^
188.         ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
189. 

libavcodec/indeo3.c:187:47: 
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;
186. 
187.         ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
                                                   ^
188.         ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
189. 

libavcodec/indeo3.c:187:9: 
185.         ctx->planes[p].height = !p ? luma_height : chroma_height;
186. 
187.         ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
             ^
188.         ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
189. 

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 true branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX - 32) || !size)
                                        ^
  73.         return NULL;
  74. 

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

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/indeo3.c:188:48: Condition is true
186. 
187.         ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
188.         ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
                                                    ^
189. 
190.         /* fill the INTRA prediction lines with the middle pixel value = 64 */

libavcodec/indeo3.c:188:47: 
186. 
187.         ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
188.         ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
                                                   ^
189. 
190.         /* fill the INTRA prediction lines with the middle pixel value = 64 */

libavcodec/indeo3.c:188:9: 
186. 
187.         ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
188.         ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
             ^
189. 
190.         /* fill the INTRA prediction lines with the middle pixel value = 64 */

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 true branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX - 32) || !size)
              ^
  73.         return NULL;
  74. 

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

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/indeo3.c:191:9: 
189. 
190.         /* fill the INTRA prediction lines with the middle pixel value = 64 */
191.         memset(ctx->planes[p].buffers[0], 0x40, ctx->planes[p].pitch);
             ^
192.         memset(ctx->planes[p].buffers[1], 0x40, ctx->planes[p].pitch);
193. 

libavcodec/indeo3.c:192:9: 
190.         /* fill the INTRA prediction lines with the middle pixel value = 64 */
191.         memset(ctx->planes[p].buffers[0], 0x40, ctx->planes[p].pitch);
192.         memset(ctx->planes[p].buffers[1], 0x40, ctx->planes[p].pitch);
             ^
193. 
194.         /* set buffer pointers = buf_ptr + pitch and thus skip the INTRA prediction line */
