diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-23 05:09:43 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-23 05:25:04 +0100 |
commit | 713dea584b118bc48803266edc8e9b380f78a778 (patch) | |
tree | 4ce95071a7aa43b3026d0b0b61be343a795c729c | |
parent | e49c2aab80cb7e6c85642cc4afd0ea471d6ef4b1 (diff) | |
download | ffmpeg-713dea584b118bc48803266edc8e9b380f78a778.tar.gz |
truemotion2: use av_mallocz()
Fixes use of uninitialized values.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/truemotion2.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index 39091dc70a..eacd728ca4 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 || |