summaryrefslogtreecommitdiff
path: root/libavcodec/cavs.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-02-14 14:39:41 +0100
committerAnton Khirnov <anton@khirnov.net>2013-02-23 13:05:43 +0100
commit4f3b058c84f570e261d743c7c22f865617fd28ac (patch)
tree0552fedf0aafd0d5febd110a6dca4bc5309c60ad /libavcodec/cavs.c
parent0dff40bfb9a0b24d56ecd64cd90c8f724cc5745f (diff)
cavs: initialize various context tables to 0
Avoids crashes with corrupted files. CC:libav-stable@libav.org
Diffstat (limited to 'libavcodec/cavs.c')
-rw-r--r--libavcodec/cavs.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c
index 16b6323a8b..e6315bc291 100644
--- a/libavcodec/cavs.c
+++ b/libavcodec/cavs.c
@@ -708,17 +708,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(int16_t));
}