summaryrefslogtreecommitdiff
path: root/libavformat/oggparsevorbis.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-26 16:37:02 +0300
committerMartin Storsjö <martin@martin.st>2013-09-26 23:14:03 +0300
commitd872fb0f7ff2ff0ba87f5ccf6a1a55ca2be472c9 (patch)
tree92ef865da60624c41be1e58c505c95508662ad7d /libavformat/oggparsevorbis.c
parent06ebc0bf9a6401733a4ce1310325de19f631819a (diff)
lavf: Reset the entry count and allocation size variables on av_reallocp failures
When av_reallocp fails, the associated variables that keep track of the number of elements in the array (and in some cases, the separate number of allocated elements) need to be reset. Not all of these might technically be needed, but it's better to reset them if in doubt, to make sure variables don't end up conflicting. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/oggparsevorbis.c')
-rw-r--r--libavformat/oggparsevorbis.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 1a9776ef15..6e106b0d2b 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -283,9 +283,12 @@ vorbis_header (AVFormatContext * s, int idx)
}
}
} else {
- int ret;
- st->codec->extradata_size =
- fixup_vorbis_headers(s, priv, &st->codec->extradata);
+ int ret = fixup_vorbis_headers(s, priv, &st->codec->extradata);
+ if (ret < 0) {
+ st->codec->extradata_size = 0;
+ return ret;
+ }
+ st->codec->extradata_size = ret;
if ((ret = avpriv_vorbis_parse_extradata(st->codec, &priv->vp))) {
av_freep(&st->codec->extradata);
st->codec->extradata_size = 0;