Skip to content

Commit fe3da2c

Browse files
shoucandangheheCopilotMeetWq
authored
fix: gif间隔为0导致卡死 (#36)
* fix: infinite loop --------- Co-authored-by: GitHub Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: meetwq <meetwq@gmail.com>
1 parent 181b77a commit fe3da2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

meme_generator_utils/src/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl<'a> CodecExt for Codec<'a> {
2626
.ok_or(Error::ImageDecodeError("Skia decode error".to_string()))?;
2727
total_duration += frame_info.duration as f32 / 1000.0;
2828
}
29-
Ok(total_duration / count as f32)
29+
Ok((total_duration / count as f32).max(0.02))
3030
}
3131

3232
fn first_frame(&mut self) -> Result<Image, Error> {

0 commit comments

Comments
 (0)