diff --git a/codec/h264/h264dec/cavlc.go b/codec/h264/h264dec/cavlc.go index da614083..bd0db4b0 100644 --- a/codec/h264/h264dec/cavlc.go +++ b/codec/h264/h264dec/cavlc.go @@ -108,15 +108,13 @@ func formCoeffTokenMap(lines [][]string) ([nColumns]tokenMap, error) { // Count the leading zeros. var nZeros int for _, c := range v { - if c == ' ' { - continue + if c == '1' { + break } if c == '0' { nZeros++ - continue } - break } // This will be the value of the coeff_token (without leading zeros).