Skip to content

Commit

Permalink
Merge branch 'hotfix/SDK-2336_Crash-at-StreamingBuffer-functionality'…
Browse files Browse the repository at this point in the history
… into 'release/v4.4.0'

SDK-2336. Crash at StreamingBuffer functionality [Hotfix for release/v4.4.0]

See merge request sdk/sdk!3793
  • Loading branch information
vmgaGH committed Sep 27, 2022
2 parents 662866f + 6d01316 commit 4d0053c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/megaapi_impl.cpp
Expand Up @@ -27110,6 +27110,13 @@ size_t StreamingBuffer::getBitRate() const
{
return 0;
}
if (length < duration)
{
LOG_err << "[Streaming] Getting the bitRate of a file whose length is SMALLER THAN its duration !!!! Media file is likely to be corrupted or invalid."
<< " [length = " << length << " bytes"
<< " , duration = " << duration << " secs]";
return static_cast<size_t>(1);
}
return length / duration;
}

Expand Down

0 comments on commit 4d0053c

Please sign in to comment.