sannies / mp4parser

A Java API to read, write and create MP4 files
Apache License 2.0
2.74k stars 563 forks source link

fix:"ClassLoader.getSystemResourceAsStream" NullPointException #471

Open gdjicasonjakesic opened 5 months ago

gdjicasonjakesic commented 5 months ago

Fix: https://github.com/sannies/mp4parser/issues/449

Problem org.mp4parser.muxer.container.mp4.MovieCreator.build(path) throws NPE Root cause InputStream is = ClassLoader.getSystemResourceAsStream("isoparser2-default.properties"); returns null. Fixed by replacing with

ClassLoader cs = Thread.currentThread().getContextClassLoader();
InputStream is = classLoader.getResourceAsStream("isoparser2-default.properties");