-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 修复错误 #123
fix: 修复错误 #123
Conversation
message/elements.go
Outdated
Md5: md5, | ||
Sha1: sha1, | ||
Size: uint32(length), | ||
Summary: utils.Ternary(len(summary) == 0, "", summary[0]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
显然这是不对的,如果没有传summary,这就是一个数组越界访问
message/elements.go
Outdated
return uint32(info.Time) | ||
} | ||
return uint32(length) | ||
return utils.Ternary(err == nil, uint32(info.Time), uint32(length)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果err不是nil,info.Time就是空指针引用
message/elements.go
Outdated
Md5: md5, | ||
Sha1: sha1, | ||
Size: uint32(length), | ||
Summary: utils.Ternary(len(summary) == 0, "", summary[0]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
message/elements.go
Outdated
Compat: &message.VideoFile{}, | ||
Size: uint32(length), | ||
Thumb: NewVideoThumb(thumb), | ||
Summary: utils.Ternary(len(summary) == 0, "", summary[0]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
写宏写混了,意识没切过来😓😓😓😓😓
No description provided.