diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-30 21:47:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-30 21:48:17 +0200 |
commit | 280beebd399b2d2c9bf58438c2aa2a22a0a53282 (patch) | |
tree | 1475b365390621522efc9e8014539f204eea169e | |
parent | a627c1a146bcd8763605bfe6f603b90ece39d7db (diff) | |
download | ffmpeg-280beebd399b2d2c9bf58438c2aa2a22a0a53282.tar.gz |
cavsdec: initialize all tables to zeros.
This ensures that they dont contain invalid values.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/cavs.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c index 26bc65cb75..47600c9683 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -653,17 +653,17 @@ void ff_cavs_init_pic(AVSContext *h) { */ void ff_cavs_init_top_lines(AVSContext *h) { /* alloc top line of predictors */ - h->top_qp = av_malloc( h->mb_width); - h->top_mv[0] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector)); - h->top_mv[1] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector)); - h->top_pred_Y = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y)); - h->top_border_y = av_malloc((h->mb_width+1)*16); - h->top_border_u = av_malloc( h->mb_width * 10); - h->top_border_v = av_malloc( h->mb_width * 10); + h->top_qp = av_mallocz( h->mb_width); + h->top_mv[0] = av_mallocz((h->mb_width*2+1)*sizeof(cavs_vector)); + h->top_mv[1] = av_mallocz((h->mb_width*2+1)*sizeof(cavs_vector)); + h->top_pred_Y = av_mallocz( h->mb_width*2*sizeof(*h->top_pred_Y)); + h->top_border_y = av_mallocz((h->mb_width+1)*16); + h->top_border_u = av_mallocz( h->mb_width * 10); + h->top_border_v = av_mallocz( h->mb_width * 10); /* alloc space for co-located MVs and types */ - h->col_mv = av_malloc( h->mb_width*h->mb_height*4*sizeof(cavs_vector)); - h->col_type_base = av_malloc(h->mb_width*h->mb_height); + h->col_mv = av_mallocz( h->mb_width*h->mb_height*4*sizeof(cavs_vector)); + h->col_type_base = av_mallocz(h->mb_width*h->mb_height); h->block = av_mallocz(64*sizeof(DCTELEM)); } |