From: Federico Tomassetti <[email protected]>
Bug-Id: CID 1257798
Bug-Id: CID 1257805
---
libavformat/oggdec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 760cc25..1dc3145 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -63,6 +63,8 @@ static int ogg_save(AVFormatContext *s)
struct ogg *ogg = s->priv_data;
struct ogg_state *ost =
av_malloc(sizeof(*ost) + (ogg->nstreams - 1) * sizeof(*ogg->streams));
+ if (!ost)
+ return AVERROR(ENOMEM);
int i;
ost->pos = avio_tell(s->pb);
ost->curidx = ogg->curidx;
@@ -190,6 +192,8 @@ static int ogg_new_buf(struct ogg *ogg, int idx)
{
struct ogg_stream *os = ogg->streams + idx;
uint8_t *nb = av_malloc(os->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!nb)
+ return AVERROR(ENOMEM);
int size = os->bufpos - os->pstart;
if (os->buf) {
--
2.2.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel