[FFmpeg-cvslog] vf_kerndeint: memset buffer to avoid use of uninitialized memory.
Michael Niedermayer
git at videolan.org
Sun Jan 6 02:44:13 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 6 02:27:22 2013 +0100| [0ef615126fd7807b6fbef5178819655d9b7eb1f9] | committer: Michael Niedermayer
vf_kerndeint: memset buffer to avoid use of uninitialized memory.
This might fix fate failures.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ef615126fd7807b6fbef5178819655d9b7eb1f9
---
libavfilter/vf_kerndeint.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libavfilter/vf_kerndeint.c b/libavfilter/vf_kerndeint.c
index 6cd9bc2..6b87ef6 100644
--- a/libavfilter/vf_kerndeint.c
+++ b/libavfilter/vf_kerndeint.c
@@ -98,12 +98,17 @@ static int config_props(AVFilterLink *inlink)
{
KerndeintContext *kerndeint = inlink->dst->priv;
const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[inlink->format];
+ int ret;
kerndeint->vsub = desc->log2_chroma_h;
kerndeint->pixel_step = av_get_bits_per_pixel(desc) >> 3;
- return av_image_alloc(kerndeint->tmp_data, kerndeint->tmp_bwidth,
+ ret = av_image_alloc(kerndeint->tmp_data, kerndeint->tmp_bwidth,
inlink->w, inlink->h, inlink->format, 1);
+ if (ret < 0)
+ return ret;
+ memset(kerndeint->tmp_data[0], 0, ret);
+ return 0;
}
static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpic)
More information about the ffmpeg-cvslog
mailing list