Skip to content

Commit

Permalink
fix reading strings (in 'url' boxes)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Jun 19, 2018
1 parent e844fda commit ecff159
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libheif/bitstream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ std::string BitstreamRange::read_string()
{
std::string str;

// Reading a string when no more data is available, returns an empty string.
// Such a case happens, for example, when reading a 'url' box without content.
if (eof()) {
return std::string();
}

for (;;) {
if (!prepare_read(1)) {
return std::string();
Expand Down

0 comments on commit ecff159

Please sign in to comment.