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>
pull/146/head
Alexandra Hájková 9 years ago committed by Luca Barbato
parent 58c3720a3c
commit 317cfaa5e0
  1. 6
      libavformat/asfdec.c

@ -590,8 +590,10 @@ static int asf_read_metadata_obj(AVFormatContext *s, const GUIDParseTable *g)
buflen); buflen);
if (!strcmp(name, "AspectRatioX") || !strcmp(name, "AspectRatioY")) { if (!strcmp(name, "AspectRatioX") || !strcmp(name, "AspectRatioY")) {
ret = asf_store_aspect_ratio(s, st_num, name, type); ret = asf_store_aspect_ratio(s, st_num, name, type);
if (ret < 0) if (ret < 0) {
return ret; av_freep(&name);
break;
}
} else { } else {
if (st_num < ASF_MAX_STREAMS) { if (st_num < ASF_MAX_STREAMS) {
if ((ret = process_metadata(s, name, name_len, val_len, type, if ((ret = process_metadata(s, name, name_len, val_len, type,

Loading…
Cancel
Save