Skip to content

Commit afd7a25

Browse files
committed
Safer initialization update
1 parent 1ae45e2 commit afd7a25

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

video_stream_mpg.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,10 @@ void VideoStreamPlaybackMPG::update(double p_delta) {
144144
seek_pos = -1.0;
145145
} else if (p_delta == 0.0) { // Initialization update
146146
frame_current = plm_decode_video(mpeg);
147-
frame_pending = true;
148-
mpeg->time = 0.0;
147+
if (frame_current) {
148+
frame_pending = true;
149+
mpeg->time = 0.0;
150+
}
149151
} else {
150152
plm_decode(mpeg, p_delta);
151153
}

0 commit comments

Comments
 (0)