avformat/oggparseogm: Check ff_alloc_extradata() for failure
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 11 Apr 2017 13:08:07 +0000 (15:08 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 11 Apr 2017 19:28:26 +0000 (21:28 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/oggparseogm.c

index cdbdfd6..e7a501b 100644 (file)
@@ -110,7 +110,8 @@ ogm_header(AVFormatContext *s, int idx)
                 size -= 52;
                 if (bytestream2_get_bytes_left(&p) < size)
                     return AVERROR_INVALIDDATA;
-                ff_alloc_extradata(st->codecpar, size);
+                if (ff_alloc_extradata(st->codecpar, size) < 0)
+                    return AVERROR(ENOMEM);
                 bytestream2_get_buffer(&p, st->codecpar->extradata, st->codecpar->extradata_size);
             }
         }