]> git.sesse.net Git - ffmpeg/commitdiff
oggparsevorbis.c: Check for OOM when using av_mallocz.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 6 May 2012 10:00:19 +0000 (12:00 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 6 May 2012 10:00:19 +0000 (12:00 +0200)
libavformat/oggparsevorbis.c

index 28de6bd8e100cd5f094185c86789e6c6a164ec46..78defd703d7a21efe7c1c0dd613c7b168359b327 100644 (file)
@@ -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 */