polimediaupv / paella-core

Paella Player core library
Educational Community License v2.0
20 stars 15 forks source link

player.frameList can be undefined, code calls frameList.getImage on it #343

Closed karendolan closed 9 months ago

karendolan commented 11 months ago

There are 2 places in the code that assume frameList is defined, but even the code directly above that assumption does not assume that frameList is defined.

When frameList is not defined, the Player throws a fatal error: Log.js:57 paella-core - Error: TypeError: Cannot set properties of undefined (setting 'getImage')

The places where frameList.getImage is being called: https://github.com/polimediaupv/paella-core/blob/main/src/js/core/ManifestParser.js#L84-L110 https://github.com/polimediaupv/paella-core/blob/main/src/js/videoFormats/es.upv.paella.audioVideoFormat.js#L157-L165

karendolan commented 11 months ago

NOTE: that error was not being thrown in the previous version of Paella 1.43.1, but is in the 1.45.0

ferserc1 commented 9 months ago

Indeed, the frameList structure should always have the following format:

frameList: {
    getImage() { ... },
    frames: []
}

And it should always be like that even if the video manifest does not contain any frames, so there is a bug.

karendolan commented 9 months ago

@ferserc1 how do you feel about https://github.com/opencast/opencast/pull/5339/files?