Commit b668d243 authored by jbr's avatar jbr

use av_malloc() in vorbis_comment()

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17188 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a3f55f0a
......@@ -71,8 +71,16 @@ vorbis_comment(AVFormatContext * as, uint8_t *buf, int size)
v++;
if (tl && vl) {
char tt[tl + 1];
char ct[vl + 1];
char *tt, *ct;
tt = av_malloc(tl + 1);
ct = av_malloc(vl + 1);
if (!tt || !ct) {
av_freep(&tt);
av_freep(&ct);
av_log(as, AV_LOG_WARNING, "out-of-memory error. skipping VorbisComment tag.\n");
continue;
}
for (j = 0; j < tl; j++)
tt[j] = toupper(t[j]);
......@@ -82,6 +90,9 @@ vorbis_comment(AVFormatContext * as, uint8_t *buf, int size)
ct[vl] = 0;
av_metadata_set(&as->metadata, tt, ct);
av_freep(&tt);
av_freep(&ct);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment