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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 possible ambiguous cases */
  69.     if (size > (INT_MAX - 32) || !size)
              ^
  70.         return NULL;
  71. 

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

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