Commit 2dbee1a3 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mp3enc: Squeeze our mp3 encoder tag into the 9byte shortname instead...

avformat/mp3enc: Squeeze our mp3 encoder tag into the 9byte shortname instead of randomly truncating
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e744e9a3
......@@ -231,7 +231,12 @@ static int mp3_write_xing(AVFormatContext *s)
// encoder short version string
if (enc) {
uint8_t encoder_str[9] = { 0 };
memcpy(encoder_str, enc->value, FFMIN(strlen(enc->value), sizeof(encoder_str)));
if ( strlen(enc->value) > sizeof(encoder_str)
&& !strcmp("Lavc libmp3lame", enc->value)) {
memcpy(encoder_str, "Lavf lame", 9);
} else
memcpy(encoder_str, enc->value, FFMIN(strlen(enc->value), sizeof(encoder_str)));
avio_write(dyn_ctx, encoder_str, sizeof(encoder_str));
} else
avio_write(dyn_ctx, "Lavf\0\0\0\0\0", 9);
......
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