indeo3: initialise pixel planes on allocation
authorKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 14 May 2012 17:33:03 +0000 (19:33 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 15 May 2012 17:05:39 +0000 (19:05 +0200)
This prevents decoder from reading garbage from it in case of errors later.

libavcodec/indeo3.c

index 0856d06..1221ffa 100644 (file)
@@ -194,6 +194,8 @@ static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx,
         /* set buffer pointers = buf_ptr + pitch and thus skip the INTRA prediction line */
         ctx->planes[p].pixels[0] = ctx->planes[p].buffers[0] + ctx->planes[p].pitch;
         ctx->planes[p].pixels[1] = ctx->planes[p].buffers[1] + ctx->planes[p].pitch;
+        memset(ctx->planes[p].pixels[0], 0, ctx->planes[p].pitch * ctx->planes[p].height);
+        memset(ctx->planes[p].pixels[1], 0, ctx->planes[p].pitch * ctx->planes[p].height);
     }
 
     return 0;