Skip to content

Commit 4c3793f

Browse files
committed
add null pointer check when taking a screenshot
1 parent fb20d5b commit 4c3793f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tasks/task_screenshot.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ static bool take_screenshot_raw(
519519
unsigned width = video_st->frame_cache_width;
520520
unsigned height = video_st->frame_cache_height;
521521
size_t pitch = video_st->frame_cache_pitch;
522+
523+
if (!data || !width || !height || !pitch)
524+
return false;
525+
522526
/* Negative pitch is needed as screenshot takes bottom-up,
523527
* but we use top-down.
524528
*/

0 commit comments

Comments
 (0)