sannies / isoviewer

GUI application to have closer look ISO 14496-12 and other MP4 files.
Apache License 2.0
230 stars 54 forks source link

crashes on regular mov file with AAC (mp4a) track #14

Open tchakabam opened 5 years ago

tchakabam commented 5 years ago

Using the latest version of Isoviewer.

Example file for repro can be found here: http://ftp.vim.org/graphics/blender/demo/movies/ToS/ToS-4k-1920.mov

The file is playable and valid, it can also be parsed using GPAC or Mp4box.js for example: https://gpac.github.io/mp4box.js/test/filereader.html

The crash happens when trying to inspect the nested mp4 sample description data.

There should be more sample-table boxes to appear, but isoviewer seems to bail on all the boxes that come after the stsd of the mp4a track here.

Screenshot:

screen shot 2018-11-12 at 18 17 49

Stacktrace of crash:

java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:3236)
    at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
    at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
    at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
    at java.nio.channels.Channels$WritableByteChannelImpl.write(Channels.java:458)
    at org.mp4parser.support.AbstractBox.getBox(AbstractBox.java:120)
    at org.mp4parser.BasicContainer.writeContainer(BasicContainer.java:138)
    at org.mp4parser.boxes.sampleentry.AudioSampleEntry.getBox(AudioSampleEntry.java:312)
    at org.mp4parser.boxes.sampleentry.AudioSampleEntry.hashCode(AudioSampleEntry.java:368)
    at java.util.HashMap.hash(HashMap.java:338)
    at java.util.LinkedHashMap.getOrDefault(LinkedHashMap.java:452)
    at org.mp4parser.isoviewer.views.MainView$root$1$2$1$1$2.invoke(MainView.kt:75)
    at org.mp4parser.isoviewer.views.MainView$root$1$2$1$1$2.invoke(MainView.kt:25)
    at tornadofx.NodesKt$onUserSelect$5.changed(Nodes.kt:532)
    at tornadofx.NodesKt$onUserSelect$5.changed(Nodes.kt)
    at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:182)
    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
    at javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:74)
    at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:102)
    at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
    at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
    at javafx.scene.control.SelectionModel.setSelectedItem(SelectionModel.java:102)
    at javafx.scene.control.MultipleSelectionModelBase.lambda$new$34(MultipleSelectionModelBase.java:67)
    at javafx.scene.control.MultipleSelectionModelBase$$Lambda$70/1562059231.invalidated(Unknown Source)
    at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
    at javafx.beans.property.ReadOnlyIntegerPropertyBase.fireValueChangedEvent(ReadOnlyIntegerPropertyBase.java:72)
    at javafx.beans.property.ReadOnlyIntegerWrapper.fireValueChangedEvent(ReadOnlyIntegerWrapper.java:102)
    at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:113)
    at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:147)
    at javafx.scene.control.SelectionModel.setSelectedIndex(SelectionModel.java:68)
    at javafx.scene.control.MultipleSelectionModelBase.select(MultipleSelectionModelBase.java:404)
tchakabam commented 5 years ago

I do understand that this stacktrace points to an error resulting from lack of heap-allocated memory, but I don't yet see how this should be allowed to happen when we are supposed to look at metadata here 🤔 The lack of memory is a consequence of a deeper issue here I guess? Maybe some unintended allocation. Just in case there should be an answer like "give your JVM more heap" or so, given my current understanding, I wouldn't see how that could be a valid fix :)