From c74f20480817788adf3d80c0ebe951e28469b11a Mon Sep 17 00:00:00 2001 From: jmillman Date: Thu, 30 Jul 2015 13:01:17 -0400 Subject: [PATCH] fix potential NPE --- Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java index 0609fab045..40569e8ec0 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/VideoUtils.java @@ -131,11 +131,11 @@ public class VideoUtils { for (int x = 0; x < THUMB_COLUMNS; x++) { for (int y = 0; y < THUMB_ROWS; y++) { if (!videoFile.set(CV_CAP_PROP_POS_MSEC, timestamp + x * framkeskip + y * framkeskip * THUMB_COLUMNS)) { - break; + break; // if we can't set the time, return black for that frame } //read the frame into the image/matrix if (!videoFile.read(imageMatrix)) { - break; //if the image for some reason is bad, return default icon + break; //if the image for some reason is bad, return black for that frame } if (bufferedImage == null) { @@ -160,6 +160,6 @@ public class VideoUtils { videoFile.release(); // close the file - return ScalrWrapper.resizeFast(bufferedImage, iconSize); + return bufferedImage == null ? bufferedImage : ScalrWrapper.resizeFast(bufferedImage, iconSize); } }