From e61037d412ec818250113611cfd42c93dfec9dcc Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 2 Jan 2016 09:56:10 +0100 Subject: [PATCH] GUI: attachment editor: fix adding new attachments The content wasn't read at all. --- src/mkvtoolnix-gui/header_editor/tab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mkvtoolnix-gui/header_editor/tab.cpp b/src/mkvtoolnix-gui/header_editor/tab.cpp index a5d5b20e8..7d8ef33f5 100644 --- a/src/mkvtoolnix-gui/header_editor/tab.cpp +++ b/src/mkvtoolnix-gui/header_editor/tab.cpp @@ -637,7 +637,6 @@ Tab::removeSelectedAttachment() { KaxAttachedPtr Tab::createAttachmentFromFile(QString const &fileName) { - QByteArray content; QFile file{fileName}; if (!file.open(QIODevice::ReadOnly)) { @@ -645,6 +644,7 @@ Tab::createAttachmentFromFile(QString const &fileName) { return {}; } + auto content = file.readAll(); auto mimeType = guess_mime_type(to_utf8(fileName), true); auto contentAsMem = std::make_shared(content.data(), content.count(), false); auto uid = create_unique_number(UNIQUE_ATTACHMENT_IDS);