mkvinfo: fix null pointer dereference for EbmlBinary data null pointers

Fixes #2072.
This commit is contained in:
Moritz Bunkus 2017-08-13 10:37:07 +02:00
parent c7b7cf6c93
commit e1f3756119
2 changed files with 5 additions and 0 deletions

View File

@ -57,6 +57,8 @@
claiming that the file had been modified externally when the user wanted to
save the file once more, requiring a reload of the file losing all
modifications made since saving the first time.
* mkvinfo: fixed a null pointer dereference if an `EbmlBinary` element's data
pointer is a null pointer. Fixes #2072.
## Build system changes

View File

@ -287,6 +287,9 @@ std::string
to_hex(const unsigned char *buf,
size_t size,
bool compact) {
if (!buf || !size)
return {};
static boost::format s_bf_to_hex("0x%|1$02x|");
static boost::format s_bf_to_hex_compact("%|1$02x|");