summaryrefslogtreecommitdiff
path: root/libavformat/oggparsevorbis.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-23 13:37:04 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-28 15:25:18 +0200
commitc1f48582428f7d5e7d93d2f0af6d4612559f74ca (patch)
tree4855edef6fd8239024576c94b48b2fdf90d500fc /libavformat/oggparsevorbis.c
parentb10a8a30dbf605fb0761c9ee64cfbe8cb87ba710 (diff)
avformat/flac_picture: Try to reuse buffer for attached picture
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/oggparsevorbis.c')
-rw-r--r--libavformat/oggparsevorbis.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index b66167ba62..77e8d301b2 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -118,7 +118,7 @@ static int vorbis_parse_single_comment(AVFormatContext *as, AVDictionary **m,
*/
if (!av_strcasecmp(t, "METADATA_BLOCK_PICTURE") && parse_picture) {
int ret, len = AV_BASE64_DECODE_SIZE(vl);
- uint8_t *pict = av_malloc(len);
+ uint8_t *pict = av_malloc(len + AV_INPUT_BUFFER_PADDING_SIZE);
if (!pict) {
av_log(as, AV_LOG_WARNING, "out-of-memory error. Skipping cover art block.\n");
@@ -126,7 +126,7 @@ static int vorbis_parse_single_comment(AVFormatContext *as, AVDictionary **m,
}
ret = av_base64_decode(pict, v, len);
if (ret > 0)
- ret = ff_flac_parse_picture(as, pict, ret, 0);
+ ret = ff_flac_parse_picture(as, &pict, ret, 0);
av_freep(&pict);
if (ret < 0) {
av_log(as, AV_LOG_WARNING, "Failed to parse cover art block.\n");