fix(ffmpeg): copy C allocated buffer to Go memory
This commit is contained in:
parent
51ff1bbbd3
commit
1493db09b2
1 changed files with 1 additions and 1 deletions
|
|
@ -282,7 +282,7 @@ func encodeFrameImage(av *AVContext) ([]byte, error) {
|
|||
if err < 0 {
|
||||
return nil, avError(err)
|
||||
}
|
||||
p := (*[1 << 30]byte)(unsafe.Pointer(pkt.data))[:pkt.size:pkt.size]
|
||||
p := C.GoBytes(unsafe.Pointer(pkt.data), pkt.size)
|
||||
if pkt.buf != nil {
|
||||
C.av_packet_unref(&pkt)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue