avcodec/dvbsubdec: use av_mallocz_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-04-22 20:00:28 +02:00
parent ea8e089ff7
commit 994a582a02
1 changed files with 1 additions and 1 deletions

View File

@ -1394,7 +1394,7 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
} }
if (sub->num_rects > 0){ if (sub->num_rects > 0){
sub->rects = av_mallocz(sizeof(*sub->rects) * sub->num_rects); sub->rects = av_mallocz_array(sizeof(*sub->rects), sub->num_rects);
for(i=0; i<sub->num_rects; i++) for(i=0; i<sub->num_rects; i++)
sub->rects[i] = av_mallocz(sizeof(*sub->rects[i])); sub->rects[i] = av_mallocz(sizeof(*sub->rects[i]));