summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorClément Bœsch <clement.boesch@smartjog.com>2012-04-05 15:14:00 +0200
committerClément Bœsch <ubitux@gmail.com>2012-04-05 17:32:54 +0200
commit614716f5831af4646329cc08db6fa47a8368883d (patch)
tree10d288aa3d850da707b0eae8e6bcf0029a92d0ef /libavformat
parentc99bdd51b2707c13273b2026690358506acef14e (diff)
mov: do not print string len in handler_name.
The handler name is stored as a pascal string in the QT specs (first byte is the length of the string), thus leading to an invalid metadata string export. Also add a second length check based on the first character to avoid overwriting an already specified handler_name (it happens with Youtube videos for instance, the handler_name get masked), or specifying an empty string metadata.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4541a6ec18..03a35047ac 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -534,7 +534,9 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return AVERROR(ENOMEM);
avio_read(pb, title_str, title_size);
title_str[title_size] = 0;
- av_dict_set(&st->metadata, "handler_name", title_str, 0);
+ if (title_str[0])
+ av_dict_set(&st->metadata, "handler_name", title_str +
+ (!c->isom && title_str[0] == title_size - 1), 0);
av_freep(&title_str);
}