Avoid unsafe dereferencing
This commit is contained in:
parent
844979be06
commit
5718ce5697
@ -111,8 +111,8 @@ func (c *protoCodec) ReadHeader(m *codec.Message, mt codec.MessageType) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
m.Method = *rtmp.ServiceMethod
|
m.Method = rtmp.GetServiceMethod()
|
||||||
m.Id = *rtmp.Seq
|
m.Id = rtmp.GetSeq()
|
||||||
case codec.Response:
|
case codec.Response:
|
||||||
data, err := ReadNetString(c.rwc)
|
data, err := ReadNetString(c.rwc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -123,9 +123,9 @@ func (c *protoCodec) ReadHeader(m *codec.Message, mt codec.MessageType) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
m.Method = *rtmp.ServiceMethod
|
m.Method = rtmp.GetServiceMethod()
|
||||||
m.Id = *rtmp.Seq
|
m.Id = rtmp.GetSeq()
|
||||||
m.Error = *rtmp.Error
|
m.Error = rtmp.GetError()
|
||||||
case codec.Publication:
|
case codec.Publication:
|
||||||
io.Copy(c.buf, c.rwc)
|
io.Copy(c.buf, c.rwc)
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user