{"record":{"id":"546cc274980aa782","repo":"pion/webrtc","slug":"w-expected-0-got-d","errorCode":null,"errorMessage":"%w: expected(0) got(%d)","messagePattern":"%w: expected\\(0\\) got\\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/media/ivfreader/ivfreader.go","lineNumber":157,"sourceCode":"\t}\n\n\theader := &IVFFileHeader{\n\t\tsignature:           string(buffer[:4]),\n\t\tversion:             binary.LittleEndian.Uint16(buffer[4:6]),\n\t\theaderSize:          binary.LittleEndian.Uint16(buffer[6:8]),\n\t\tFourCC:              string(buffer[8:12]),\n\t\tWidth:               binary.LittleEndian.Uint16(buffer[12:14]),\n\t\tHeight:              binary.LittleEndian.Uint16(buffer[14:16]),\n\t\tTimebaseDenominator: binary.LittleEndian.Uint32(buffer[16:20]),\n\t\tTimebaseNumerator:   binary.LittleEndian.Uint32(buffer[20:24]),\n\t\tNumFrames:           binary.LittleEndian.Uint32(buffer[24:28]),\n\t\tunused:              binary.LittleEndian.Uint32(buffer[28:32]),\n\t}\n\n\tif header.signature != ivfFileHeaderSignature {\n\t\treturn nil, errSignatureMismatch\n\t} else if header.version != uint16(0) {\n\t\treturn nil, fmt.Errorf(\"%w: expected(0) got(%d)\", errUnknownIVFVersion, header.version)\n\t}\n\n\ti.bytesReadSuccesfully += int64(bytesRead)\n\n\treturn header, nil\n}\n","sourceCodeStart":139,"sourceCodeEnd":164,"githubUrl":"https://github.com/pion/webrtc/blob/8c25dc09fa9e7c09aac4309ead88093d760432b0/pkg/media/ivfreader/ivfreader.go#L139-L164","documentation":"Thrown by parseFileHeader after reading an IVF file header whose version field is not 0. The IVF format defines version 0 as the only valid value; a nonzero version means the file is malformed, corrupted, or not actually IVF despite a matching signature, so the parser rejects it before returning the header to NewWith callers.","triggerScenarios":"Thrown at pkg/media/ivfreader/ivfreader.go:157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the input file is a genuine IVF container produced by a standard muxer (e.g. ffmpeg's ivf muxer) and not a renamed or truncated file","Inspect bytes 4-6 of the file (the version field) with a hex dump to confirm the value being rejected","Re-mux the source stream into a fresh IVF file with a known-good tool instead of hand-crafting the header","If a nonzero version must be tolerated, patch parseFileHeader to accept it explicitly — but note the reader's field offsets are only validated for version 0"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c25dc09fa9e7c09aac4309ead88093d760432b0","analyzedAt":"2026-09-03T21:56:56.182Z","contentChangedAt":"2026-09-03T21:56:56.182Z","schemaVersion":2},"datasetVersion":"2026-09-11T07:07:21.782Z"}