mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-05 16:16:50 +08:00
Check if the frame is writable before copyPlanes (#84)
* check if the frame is writable before copyPlanes * apply review * make f2 writable
This commit is contained in:
@@ -518,5 +518,14 @@ func TestFrameData(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
b9 := []byte(fmt.Sprintf("%+v", b8))
|
||||
require.Equal(t, b3, b9)
|
||||
|
||||
f3 := AllocFrame()
|
||||
defer f3.Free()
|
||||
require.NoError(t, f3.Ref(f2))
|
||||
require.Error(t, fd2.FromImage(i1))
|
||||
require.Error(t, fd2.SetBytes(b1, align))
|
||||
f2.MakeWritable()
|
||||
require.NoError(t, fd2.FromImage(i1))
|
||||
require.NoError(t, fd2.SetBytes(b1, align))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user