npm mediabunny 1.62.0
v1.62.0

4 hours ago

In addition to tons of general bug fixes and improvements, this release thoroughly hardens Mediabunny against bad/malicious inputs. These are files meant to exhaust memory, clog CPU, or cause Mediabunny to get stuck in an infinite loop. With these fixes in place, you can be almost certain that you can throw any untrusted user input at Mediabunny and it'll handle it well. Malformed or malicious inputs will now throw errors immediately. Across the board, the library is now more robust and more performant, even for well-formed inputs.

  • Added InputFormat.supportsTimestampedMediaData, mirroring the same field on OutputFormat
  • Removed heuristic-based HLS timestamp logic, which caused wrong results for some incorrect playlists (#574)
  • Made HLS random-access seeking robust in the presence of incorrect #EXTINF tags
  • Fixed Ogg muxer writing incorrect granule positions on pages with 255 segments (#577)
  • Fixed ISOBMFF tfra sample references not being respected, leading to incorrect timestamps (#578)
  • Improved MPEG-TS demuxer video segmentation and timestamp logic, and drop packets that contain no pictures in them (#576)
  • Fixed fractional audio sample offset trimming leading to error in Conversion API (#579)
  • @mediabunny/prores: Updated TurboRes to protect against malicious files that cause out-of-bounds reads
  • Fixed ISOBMFF sample tables with huge declared sample counts exhausting memory and CPU
  • Reduced memory usage and sped up lookups for ISOBMFF files with composition time offsets
  • Fixed ISOBMFF demuxer iterating over nonexistent samples when stts, stsz and stsc disagree on the sample count
  • Fixed slow packet iteration for ISOBMFF chunks containing many samples
  • Fixed trun boxes with huge sample counts exhausting memory; fragments are now limited to 2^20 samples
  • Fixed faulty tfra entries causing the file to be rescanned over and over
  • Fixed slow tfra parsing for many entries or many duplicate timestamps
  • Fixed ISOBMFF fragment lookups re-reading fragments without data for the track
  • Fixed slow ISOBMFF parsing for files with many tracks
  • Fixed slow reading of fragmented ISOBMFF files with decreasing fragment timestamps
  • Fixed deeply nested ISOBMFF boxes overflowing the stack
  • Fixed PCM tracks in ISOBMFF whose stsc doesn't start at the first chunk
  • Fixed stsc entries with non-increasing chunk indices blowing up chunk iteration; they are now skipped with a warning
  • Fixed unsorted stss boxes breaking key frame lookups
  • Fixed huge encryption subsample sizes causing huge allocations
  • Fixed assertion errors for misplaced trak, moof, traf, tfhd, tfdt, trun and senc boxes
  • Fixed assertion errors for codec configuration boxes in tracks of the wrong type
  • Fixed a failed sample table parse or a broken fragment leaving behind state that broke later reads
  • ISOBMFF demuxer now throws for zero mvhd/mdhd timescales, a missing mvhd, invalid stz2 field sizes, invalid keys entry sizes, malformed pssh boxes, oversized tenc IVs, and trun boxes without sample values or defaults
  • Fixed Matroska resyncing getting stuck at the end of the file or on cluster IDs with broken sizes
  • Fixed Matroska elements referenced by multiple seek entries or segments being parsed repeatedly
  • Fixed slow parsing of Matroska seek heads with many entries
  • Fixed faulty Matroska cue points causing the file to be rescanned over and over
  • Fixed slow deduplication of Matroska cue points
  • Fixed Matroska laced blocks claiming many empty frames exhausting memory and CPU
  • Fixed Matroska header stripping being applied to entire laced blocks instead of each frame
  • Fixed Matroska lookups for tracks without blocks rescanning all clusters
  • Fixed slow reading of Matroska files with decreasing cluster timestamps
  • Fixed slow next key packet retrieval for Matroska clusters with many blocks
  • Fixed slow Matroska parsing for files with many tracks
  • Fixed deeply nested Matroska elements overflowing the stack
  • Fixed huge Matroska strings overflowing the stack
  • Fixed zero-width Matroska unsigned integers being rejected
  • Fixed assertion errors for invalid Matroska block lacing
  • Fixed concurrent getMetadataTags() calls on Matroska files failing
  • Fixed a failed Matroska tag read breaking subsequent attempts
  • Matroska tracks sharing a track number are now dropped with a warning
  • Matroska demuxer now throws for unsigned integers larger than 8 bytes, a zero TimestampScale, an invalid SamplingFrequency and zero Channels
  • Fixed ADTS frames with zero length causing an infinite loop
  • Fixed ADTS frames with a reserved sampling frequency index or a truncated header causing errors
  • Fixed huge SPS frame buffering values causing excessive packet buffering and rescanning
  • Fixed exp-Golomb values with 31 leading zeros decoding to negative numbers
  • Fixed SPS cropping away the entire picture causing an assertion error
  • Fixed slow MPEG-TS key packet lookups for streams without random access indicators
  • Fixed MPEG-TS assertion error when a key frame takes its timestamp from a later PES packet
  • Fixed truncated recovery point SEIs making MPEG-TS streams unreadable
  • Fixed slow MPEG-TS metadata reading for files with many streams
  • Fixed MPEG-TS PES packets without data desyncing packet reading
  • Fixed MPEG-TS init inputs passing on info for streams they never set up
  • Fixed Ogg pages without segments, truncated pages and junk between pages causing errors
  • Fixed Ogg seeking computing checksums over large amounts of data for fake page headers
  • Fixed Ogg seeking failing for continuation pages without a preceding packet
  • Fixed slow Ogg parsing for files with many logical bitstreams; more than 64 now throws
  • Fixed short Opus and Vorbis identification headers causing errors
  • Vorbis identification headers with zero channels or sample rate now throw
  • Fixed slow parsing of Vorbis comments with many repeated keys
  • Fixed FLAC files without frames causing an infinite loop
  • Fixed FLAC metadata blocks extending past the end of the file causing assertion errors
  • Fixed FLAC files without a last metadata block flag
  • Fixed truncated FLAC frame headers at the end of the file causing errors
  • Fixed malformed FLAC pictures aborting metadata reading
  • Fixed huge METADATA_BLOCK_PICTURE MIME types overflowing the stack
  • FLAC demuxer now throws for short STREAMINFO blocks and a zero sample rate
  • WAVE demuxer now throws for zero channels, sample rate or block alignment, and for short fmt and ds64 chunks
  • Fixed malformed WAVE LIST and id3 chunks causing errors
  • Fixed PCM decoding producing invalid frame counts for malformed packets
  • Fixed slow parsing of unsynchronized ID3v2 tags with many frames
  • Fixed short ID3v2 extended headers and frames extending past the tag causing errors
  • ID3v2 frames shorter than their fixed fields now throw
  • Fixed HLS variable substitution blowing up exponentially; excessive substitution now throws
  • HLS demuxer now throws for playlists with more than 256 variant streams or media tags
  • Fixed HLS live playlists with a zero target duration reloading in a busy loop
  • Fixed huge HLS durations and media sequence numbers overflowing timestamp math
  • Fixed malformed percent-encoding in HLS query parameters throwing a URIError
  • Fixed HLS reading huge non-playlist files in their entirety
  • Fixed HLS segments starting with a delta frame having it returned as a key packet
  • HLS demuxer now throws when the playlist codec doesn't match the media data
  • Fixed key packet verification looping forever for very large timestamps
  • Fixed ReadableStreamSource allocating unfulfillable huge reads up front
  • Fixed CustomSource reads past the end of the file causing errors
  • Fixed zero video dimensions breaking pixel aspect ratio computation

Don't miss a new mediabunny release

NewReleases is sending notifications on new releases.