Skip to content

Commit

Permalink
fix crash divide by zero with progress crop
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Jan 30, 2019
1 parent e584d07 commit 9ae10d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion replay-filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void replay_filter_offscreen_render(void* data, uint32_t cx, uint32_t cy)
}

struct video_frame output_frame;
if (video_output_lock_frame(filter->video_output,
if (filter->video_output && video_output_lock_frame(filter->video_output,
&output_frame, 1, os_gettime_ns()))
{
if (filter->video_data) {
Expand Down
2 changes: 1 addition & 1 deletion replay-source.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static void replay_update_progress_crop(struct replay_source* context, uint64_t
{
struct siu siu;
siu.source = s;
if(t && context->current_replay.last_frame_timestamp){
if(t && context->current_replay.last_frame_timestamp && context->current_replay.duration){
siu.crop_width = (context->current_replay.last_frame_timestamp - t) * width / context->current_replay.duration;
}else
{
Expand Down

0 comments on commit 9ae10d2

Please sign in to comment.