mirror of https://bitbucket.org/ausocean/av.git
codec/h264/lex.go: fixed handling of errors from ScanUntil
This commit is contained in:
parent
bf289221de
commit
78484b5f5b
|
@ -72,7 +72,13 @@ func Lex(dst io.Writer, src io.Reader, delay time.Duration) error {
|
||||||
var err error
|
var err error
|
||||||
buf, b, err = c.ScanUntil(buf, 0x00)
|
buf, b, err = c.ScanUntil(buf, 0x00)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
if err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if len(buf) != 0 {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return io.EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
for n := 1; b == 0x0 && n < 4; n++ {
|
for n := 1; b == 0x0 && n < 4; n++ {
|
||||||
|
|
Loading…
Reference in New Issue