[FFmpeg-cvslog] oggparsevorbis.c: Check for OOM when using av_mallocz.

Carl Eugen Hoyos git at videolan.org
Sun May 6 12:02:28 CEST 2012


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun May  6 12:00:19 2012 +0200| [84aea80f7824c23b4cbf101f03e2b5b418a79d80] | committer: Carl Eugen Hoyos

oggparsevorbis.c: Check for OOM when using av_mallocz.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=84aea80f7824c23b4cbf101f03e2b5b418a79d80
---

 libavformat/oggparsevorbis.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 28de6bd..78defd7 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 */



More information about the ffmpeg-cvslog mailing list