Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-1166

FLVParser NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1, 1.2, 1.3, 1.4
    • 1.5
    • parser
    • All

    Description

      On certain video files, the FLV parser throws an NPE on line 242.

      The piece of code causing this is the following:
      https://github.com/apache/tika/blob/1.4/tika-parsers/src/main/java/org/apache/tika/parser/video/FLVParser.java#L242

      241: for (Entry<String, Object> entry : extractedMetadata.entrySet()) {
      242:   metadata.set(entry.getKey(), entry.getValue().toString());
      243: }
      

      Which should probably be replaced by something like this:

      241: for (Entry<String, Object> entry : extractedMetadata.entrySet()) {
      242:   if (entry.getValue() == null) continue;
      243:   metadata.set(entry.getKey(), entry.getValue().toString());
      244: }
      

      Exception trace :

      [root@hermes backend]# java -jar bin/tika-app-1.1.jar -j ./data.mp4
      Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.video.FLVParser@58d9660d
              at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
              at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
              at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
              at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:130)
              at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:397)
              at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:101)
      Caused by: java.lang.NullPointerException
              at org.apache.tika.parser.video.FLVParser.parse(FLVParser.java:242)
              at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
              ... 5 more
      org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
              at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:130)
              at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:397)
              at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:101)
      Caused by: java.lang.NullPointerException
              at org.apache.tika.parser.video.FLVParser.parse(FLVParser.java:242)
              at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
              ... 5 more
      

      Attachments

        1. data.mp4
          4.99 MB
          david rapin

        Activity

          People

            rgauss Ray Gauss II
            david_p david rapin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified