diff options
author | Alexandra Hájková <alexandra.khirnova@gmail.com> | 2015-08-13 10:16:20 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-08-16 20:00:37 +0200 |
commit | 317cfaa5e09755ed0b34af512ec687963a67bdbf (patch) | |
tree | 52ad81bb69e3073610cbb21a7a5211e73bbf0c10 | |
parent | 58c3720a3cc71142b5d48d8ccdc9213f9a66cd33 (diff) | |
download | ffmpeg-317cfaa5e09755ed0b34af512ec687963a67bdbf.tar.gz |
asfdec: prevent the memory leak in the asf_read_metada_obj
also do not return the error code but just break reading
metadata object in the case of the aspect ratio reading failure
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | libavformat/asfdec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 93e8c3cdfa..4b04227a71 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -590,8 +590,10 @@ static int asf_read_metadata_obj(AVFormatContext *s, const GUIDParseTable *g) buflen); if (!strcmp(name, "AspectRatioX") || !strcmp(name, "AspectRatioY")) { ret = asf_store_aspect_ratio(s, st_num, name, type); - if (ret < 0) - return ret; + if (ret < 0) { + av_freep(&name); + break; + } } else { if (st_num < ASF_MAX_STREAMS) { if ((ret = process_metadata(s, name, name_len, val_len, type, |