diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-22 15:04:34 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-22 15:04:34 +0200 |
commit | e8e9186a70ae949226601d2bf23dfedcd09c5f83 (patch) | |
tree | ef06dcc5144bc68a682ca3c54600d9b7b7dd3353 /libavcodec/pgssubdec.c | |
parent | f932e5f7169282daaa06b08500d2c632cf70e14e (diff) | |
download | ffmpeg-e8e9186a70ae949226601d2bf23dfedcd09c5f83.tar.gz |
avcodec/pgssubdec: Use av_malloc(z)_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pgssubdec.c')
-rw-r--r-- | libavcodec/pgssubdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index b2c779a3ca..df612de460 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -341,7 +341,7 @@ static int parse_presentation_segment(AVCodecContext *avctx, } av_freep(&ctx->presentation.objects); - ctx->presentation.objects = av_malloc(sizeof(PGSSubPictureReference) * ctx->presentation.object_count); + ctx->presentation.objects = av_malloc_array(ctx->presentation.object_count, sizeof(PGSSubPictureReference)); if (!ctx->presentation.objects) { ctx->presentation.object_count = 0; return AVERROR(ENOMEM); @@ -417,7 +417,7 @@ static int display_end_segment(AVCodecContext *avctx, void *data, sub->format = 0; sub->num_rects = ctx->presentation.object_count; - sub->rects = av_mallocz(sizeof(*sub->rects) * sub->num_rects); + sub->rects = av_mallocz_array(sub->num_rects, sizeof(*sub->rects)); for (rect = 0; rect < sub->num_rects; ++rect) { uint16_t picture_id = ctx->presentation.objects[rect].picture_id; |