diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-05-06 12:00:19 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-05-06 12:00:19 +0200 |
commit | 84aea80f7824c23b4cbf101f03e2b5b418a79d80 (patch) | |
tree | 5f6792fa179370cb9c34fe6e2820b699aba69f78 /libavformat/oggparsevorbis.c | |
parent | 517dcc9b5fc4294669c0b6edaaa3ff166d412219 (diff) | |
download | ffmpeg-84aea80f7824c23b4cbf101f03e2b5b418a79d80.tar.gz |
oggparsevorbis.c: Check for OOM when using av_mallocz.
Diffstat (limited to 'libavformat/oggparsevorbis.c')
-rw-r--r-- | libavformat/oggparsevorbis.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 28de6bd8e1..78defd703d 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 */ |