[FFmpeg-cvslog] truemotion2: use av_mallocz()
Michael Niedermayer
git at videolan.org
Wed Jan 23 05:29:39 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jan 23 05:09:43 2013 +0100| [713dea584b118bc48803266edc8e9b380f78a778] | committer: Michael Niedermayer
truemotion2: use av_mallocz()
Fixes use of uninitialized values.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=713dea584b118bc48803266edc8e9b380f78a778
---
libavcodec/truemotion2.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 39091dc..eacd728 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -934,15 +934,15 @@ static av_cold int decode_init(AVCodecContext *avctx)
w += 8;
h += 8;
- l->Y1_base = av_malloc(sizeof(*l->Y1_base) * w * h);
- l->Y2_base = av_malloc(sizeof(*l->Y2_base) * w * h);
+ l->Y1_base = av_mallocz(sizeof(*l->Y1_base) * w * h);
+ l->Y2_base = av_mallocz(sizeof(*l->Y2_base) * w * h);
l->y_stride = w;
w = (w + 1) >> 1;
h = (h + 1) >> 1;
- l->U1_base = av_malloc(sizeof(*l->U1_base) * w * h);
- l->V1_base = av_malloc(sizeof(*l->V1_base) * w * h);
- l->U2_base = av_malloc(sizeof(*l->U2_base) * w * h);
- l->V2_base = av_malloc(sizeof(*l->V1_base) * w * h);
+ l->U1_base = av_mallocz(sizeof(*l->U1_base) * w * h);
+ l->V1_base = av_mallocz(sizeof(*l->V1_base) * w * h);
+ l->U2_base = av_mallocz(sizeof(*l->U2_base) * w * h);
+ l->V2_base = av_mallocz(sizeof(*l->V1_base) * w * h);
l->uv_stride = w;
l->cur = 0;
if (!l->Y1_base || !l->Y2_base || !l->U1_base ||
More information about the ffmpeg-cvslog
mailing list