aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-06-16 19:17:26 -0300
committerJames Almer <jamrial@gmail.com>2016-06-20 23:04:42 -0300
commitafd04058bc910e4a3b1017e03ea543d8be395818 (patch)
treefdb21f55834e8a7e2dd5b14067970d7dcbf932ec
parent8b5b756c4d78c80051d23f2e95d21de01d74cd1f (diff)
downloadffmpeg-afd04058bc910e4a3b1017e03ea543d8be395818.tar.gz
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: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/oggparsevorbis.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index c16871873e..89f40f6379 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -161,10 +161,11 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
av_freep(&ct);
continue;
}
- if ((ret = av_base64_decode(pict, ct, len)) > 0)
- ret = ff_flac_parse_picture(as, pict, ret);
+ ret = av_base64_decode(pict, ct, len);
av_freep(&tt);
av_freep(&ct);
+ if (ret > 0)
+ ret = ff_flac_parse_picture(as, pict, ret);
av_freep(&pict);
if (ret < 0) {
av_log(as, AV_LOG_WARNING, "Failed to parse cover art block.\n");