Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8118703

BufferOverflowException parsing FLV metadata

    XMLWordPrintable

    Details

      Description

      Attempting to play http://reavers.us.oracle.com/flv/BlackPearl.flv gives this exception:

      Exception in thread "Thread-7" java.nio.BufferOverflowException
      at java.nio.Buffer.nextPutIndex(Buffer.java:495)
      at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:145)
      at com.sun.media.jfxmedia.metadata.MetadataParser.getNextByte(MetadataParser.java:267)
      at com.sun.media.jfxmedia.metadata.MetadataParser.getShort(MetadataParser.java:321)
      at com.sun.media.jfxmedia.metadata.FLVMetadataParser.readDataValue(FLVMetadataParser.java:140)
      at com.sun.media.jfxmedia.metadata.FLVMetadataParser.skipObject(FLVMetadataParser.java:199)
      at com.sun.media.jfxmedia.metadata.FLVMetadataParser.readDataValue(FLVMetadataParser.java:156)
      at com.sun.media.jfxmedia.metadata.FLVMetadataParser.parseDataTag(FLVMetadataParser.java:122)
      at com.sun.media.jfxmedia.metadata.FLVMetadataParser.parse(FLVMetadataParser.java:87)
      at com.sun.media.jfxmedia.metadata.MetadataParser.run(MetadataParser.java:177)

      Note that the FLV stream contains an unsupported type of video encoding. In theory the audio track should still play.

      Magic: FLV
      Version: 1
      Has audio: yes
      Has video: yes
      Offset: 9
      --- Tag #1 at 0xD (13) ---
      Tag type: Meta
      Body length: 810
      Timestamp: 0
      * Metadata event name: onMetaData
      * Metadata contents: {
          'duration' => 55.615
          'videodatarate' => 327.298318799
          'lastkeyframetimestamp' => 54.88
          'lastkeyframelocation' => 2266152
          'creator' => 'YouTube, Inc.'
          'metadatacreator' => 'YouTube Metadata Injector.'
          'haskeyframes' => true
          'hasmetadata' => true
          'keyframes' => {
              'times': [
                  0
                  0.08
                  0.12
                  0.16
                  0.2
                  0.24
                  0.28
                  0.32
                  0.36
                  0.4
                  0.44
                  0.52
                  0.6
                  0.92
                  10.32
                  20.32
                  26.28
                  30.28
                  40.28
                  42.88
                  52.88
                  54.04
                  54.08
                  54.12
                  54.16
                  54.2
                  54.24
                  54.28
                  54.32
                  54.88
              ]
              'filepositions': [
                  1115
                  4373
                  6673
                  9190
                  11562
                  14403
                  16726
                  19332
                  21761
                  24359
                  26834
                  30521
                  34218
                  45994
                  391635
                  799350
                  1030640
                  1276846
                  1691447
                  1820508
                  2194910
                  2241030
                  2243688
                  2246095
                  2248670
                  2251035
                  2253752
                  2256103
                  2258581
                  2266152
              ]
              '': 1.11253910098e-308
              '': 7.50957150051e-308
          }
      }
      * Missing: 28 bytes
      Previous tag size: 0
      --- Tag #2 at 0x346 (838) ---
      Tag type: Audio
      Body length: 262
      Timestamp: 0
      * Sound type: Mono
      * Sound size: 16 bits
      * Sound rate: 22 kHz
      * Sound format: MP3
      Previous tag size: 273
      --- Tag #3 at 0x45B (1115) ---
      Tag type: Video
      Body length: 1994
      Timestamp: 0
      * Video codec: Sorensen H.263
      * Video frame type: keyframe
      Previous tag size: 2005

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ddehaven David Dehaven (Inactive)
              Reporter:
              bpb Brian Burkhalter
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: