From: Carl Eugen Hoyos Date: Sun, 6 May 2012 10:00:19 +0000 (+0200) Subject: oggparsevorbis.c: Check for OOM when using av_mallocz. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=84aea80f7824c23b4cbf101f03e2b5b418a79d80;p=ffmpeg oggparsevorbis.c: Check for OOM when using av_mallocz. --- diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 28de6bd8e10..78defd703d7 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -223,6 +223,8 @@ vorbis_header (AVFormatContext * s, int idx) priv->len[pkt_type >> 1] = os->psize; priv->packet[pkt_type >> 1] = av_mallocz(os->psize); + if (!priv->packet[pkt_type >> 1]) + return AVERROR(ENOMEM); memcpy(priv->packet[pkt_type >> 1], os->buf + os->pstart, os->psize); if (os->buf[os->pstart] == 1) { const uint8_t *p = os->buf + os->pstart + 7; /* skip "\001vorbis" tag */