Commit 3e2a5b33 authored by Paul B Mahol's avatar Paul B Mahol

avformat/matroskadec: use av_malloc_array() and check for allocation error

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 13eff473
......@@ -1770,7 +1770,9 @@ static int matroska_read_header(AVFormatContext *s)
track->audio.sub_packet_h <= 0 || track->audio.frame_size <= 0 ||
track->audio.sub_packet_size <= 0)
return AVERROR_INVALIDDATA;
track->audio.buf = av_malloc(track->audio.frame_size * track->audio.sub_packet_h);
track->audio.buf = av_malloc_array(track->audio.sub_packet_h, track->audio.frame_size);
if (!track->audio.buf)
return AVERROR(ENOMEM);
if (codec_id == AV_CODEC_ID_RA_288) {
st->codec->block_align = track->audio.coded_framesize;
track->codec_priv.size = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment