Commit 614716f5 authored by Clément Bœsch's avatar Clément Bœsch Committed by Clément Bœsch

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.
parent c99bdd51
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment