mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
fix potential NPE
This commit is contained in:
parent
9fe0e26cef
commit
c74f204808
@ -131,11 +131,11 @@ public class VideoUtils {
|
|||||||
for (int x = 0; x < THUMB_COLUMNS; x++) {
|
for (int x = 0; x < THUMB_COLUMNS; x++) {
|
||||||
for (int y = 0; y < THUMB_ROWS; y++) {
|
for (int y = 0; y < THUMB_ROWS; y++) {
|
||||||
if (!videoFile.set(CV_CAP_PROP_POS_MSEC, timestamp + x * framkeskip + y * framkeskip * THUMB_COLUMNS)) {
|
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
|
//read the frame into the image/matrix
|
||||||
if (!videoFile.read(imageMatrix)) {
|
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) {
|
if (bufferedImage == null) {
|
||||||
@ -160,6 +160,6 @@ public class VideoUtils {
|
|||||||
|
|
||||||
videoFile.release(); // close the file
|
videoFile.release(); // close the file
|
||||||
|
|
||||||
return ScalrWrapper.resizeFast(bufferedImage, iconSize);
|
return bufferedImage == null ? bufferedImage : ScalrWrapper.resizeFast(bufferedImage, iconSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user