Skip to content
Snippets Groups Projects
Commit 2467c301 authored by srosse's avatar srosse
Browse files

OO-1369: catch more exceptions and errors thrown by the jcodec library

parent 67c43c2e
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,6 @@ package org.olat.core.commons.services.video; ...@@ -22,7 +22,6 @@ package org.olat.core.commons.services.video;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
...@@ -90,7 +89,7 @@ public class MovieServiceImpl implements MovieService, ThumbnailSPI { ...@@ -90,7 +89,7 @@ public class MovieServiceImpl implements MovieService, ThumbnailSPI {
int w = size.getWidth(); int w = size.getWidth();
int h = size.getHeight(); int h = size.getHeight();
return new Size(w, h, false); return new Size(w, h, false);
} catch (IOException e) { } catch (Exception | AssertionError e) {
log.error("Cannot extract size of: " + media, e); log.error("Cannot extract size of: " + media, e);
} }
} else if(suffix.equals("flv")) { } else if(suffix.equals("flv")) {
...@@ -124,8 +123,8 @@ public class MovieServiceImpl implements MovieService, ThumbnailSPI { ...@@ -124,8 +123,8 @@ public class MovieServiceImpl implements MovieService, ThumbnailSPI {
size = new FinalSize(scaledSize.getWidth(), scaledSize.getHeight()); size = new FinalSize(scaledSize.getWidth(), scaledSize.getHeight());
} }
//NullPointerException can be thrown if the jcodec cannot handle the codec of the movie //NullPointerException can be thrown if the jcodec cannot handle the codec of the movie
//ArrayIndexOutOfBoundsException //ArrayIndexOutOfBoundsException
} catch (Exception e) { } catch (Exception | AssertionError e) {
log.error("", e); log.error("", e);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment