Commit afd04058 authored by James Almer's avatar James Almer

avformat/oggparsevorbis: free base64 encoded data immediately after decoding it

It has no use afterwards and freeing it before calling ff_flac_parse_picture()
may help prevent OOM issues on memory constrained scenarios.
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 8b5b756c
...@@ -161,10 +161,11 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m, ...@@ -161,10 +161,11 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
av_freep(&ct); av_freep(&ct);
continue; continue;
} }
if ((ret = av_base64_decode(pict, ct, len)) > 0) ret = av_base64_decode(pict, ct, len);
ret = ff_flac_parse_picture(as, pict, ret);
av_freep(&tt); av_freep(&tt);
av_freep(&ct); av_freep(&ct);
if (ret > 0)
ret = ff_flac_parse_picture(as, pict, ret);
av_freep(&pict); av_freep(&pict);
if (ret < 0) { if (ret < 0) {
av_log(as, AV_LOG_WARNING, "Failed to parse cover art block.\n"); av_log(as, AV_LOG_WARNING, "Failed to parse cover art block.\n");
......
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