mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/pgssubdec: Use av_malloc*_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
0f08b587fa
commit
4207c5a4ce
@ -166,7 +166,7 @@ static int decode_rle(AVCodecContext *avctx, AVSubtitleRect *rect,
|
||||
|
||||
rle_bitmap_end = buf + buf_size;
|
||||
|
||||
rect->pict.data[0] = av_malloc(rect->w * rect->h);
|
||||
rect->pict.data[0] = av_malloc_array(rect->w, rect->h);
|
||||
|
||||
if (!rect->pict.data[0])
|
||||
return AVERROR(ENOMEM);
|
||||
@ -509,7 +509,7 @@ static int display_end_segment(AVCodecContext *avctx, void *data,
|
||||
// Blank if last object_count was 0.
|
||||
if (!ctx->presentation.object_count)
|
||||
return 1;
|
||||
sub->rects = av_mallocz(sizeof(*sub->rects) * ctx->presentation.object_count);
|
||||
sub->rects = av_mallocz_array(ctx->presentation.object_count, sizeof(*sub->rects));
|
||||
if (!sub->rects) {
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user