summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--softhddev.c15
2 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 92a44c4..a2f4d51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
User johns
Date:
+ Fix bug: Grabbing a JPG image fails while suspended.
Add support for hot keys.
Add support to use characters input in edit mode.
Adds trick speed support.
diff --git a/softhddev.c b/softhddev.c
index 3a83099..f33d739 100644
--- a/softhddev.c
+++ b/softhddev.c
@@ -1186,15 +1186,20 @@ uint8_t *CreateJpeg(uint8_t * image, int raw_size, int *size, int quality,
uint8_t *GrabImage(int *size, int jpeg, int quality, int width, int height)
{
if (jpeg) {
- uint8_t *jpg_image;
uint8_t *image;
- int raw_size = 0;
+ int raw_size;
+ raw_size = 0;
image = VideoGrab(&raw_size, &width, &height, 0);
- jpg_image = CreateJpeg(image, size, quality, width, height);
+ if (image) { // can fail, suspended, ...
+ uint8_t *jpg_image;
- free(image);
- return jpg_image;
+ jpg_image = CreateJpeg(image, size, quality, width, height);
+
+ free(image);
+ return jpg_image;
+ }
+ return NULL;
}
if (width != -1 && height != -1) {
Warning(_("softhddev: scaling unsupported\n"));