Add sanity check to prevent null duration from corrupting playlist meta
This commit is contained in:
parent
693c0e8673
commit
9c44488d8e
2 changed files with 6 additions and 1 deletions
|
|
@ -935,6 +935,11 @@ PlaylistModule.prototype._addItem = function (media, data, user, cb) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (isNaN(media.seconds)) {
|
||||
LOGGER.warn("Detected NaN duration for %j", media);
|
||||
return qfail("Internal error: could not determine media duration");
|
||||
}
|
||||
|
||||
if (data.maxlength > 0 && media.seconds > data.maxlength) {
|
||||
return qfail("Video exceeds the maximum length set by the channel admin: " +
|
||||
data.maxlength + " seconds");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue