<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi.<div class="">I am trying to implement an ogg codec using libogg, and testing with a piece of encoded data you can see below. It consists of 4 pages, the first two being header data, the third containing two packets of data and the last containing one packet of data. I am confused at the results I get if I corrupt the third page (The first one of the two that contain data).</div><div class=""><br class=""></div><div class="">If I corrupt the first page, then I will successfully read out packets with the packetno set to 1, 2, 3, and 4 respectively which is what I expect. Packet 0 is the first page which is corrupt and can therefore not be read out.</div><div class=""><br class=""></div><div class="">I get the similar results if I corrupt the second page. Specifically, I get packets with packetno set to 0, 2, 3, and 4. </div><div class=""><br class=""></div><div class="">But, if I corrupt the third page, then I get packets number 0, 1, and 3. How can this happen? Packet 3 is the second half of the third page, and the third page is corrupt and should not be read out. Looking at the actual data returned, it is clear that the data refers to the packet that gets number 4 in the uncorrupted stream.</div><div class=""><br class=""></div><div class="">Is there something here I am misunderstanding with how packetno works?</div><div class=""><br class=""></div><div class="">The data I am using looks like this:</div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">[<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">79</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">103</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">103</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">83</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">2</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">57</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">48</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">189</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">48</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">234</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">15</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">19</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">79</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">112</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">117</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">115</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">72</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">101</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">97</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">120</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">68</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">172</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">79</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">103</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">103</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">83</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">57</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">48</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">154</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">72</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">203</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">178</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">28</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">79</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">112</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">117</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">115</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">84</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">97</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">103</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">115</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">12</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">83</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">111</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">117</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">110</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">100</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">87</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">105</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">116</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">110</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">101</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">115</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">115</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">79</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">103</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">103</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">83</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">128</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">7</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">57</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">48</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">2</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">63</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">2</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">201</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">64</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">2</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">18</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">18</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">8</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">130</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">137</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">190</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">114</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">64</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">119</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">135</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">85</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">254</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">130</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">171</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">104</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">117</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">44</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">140</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">168</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">232</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">8</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">188</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">54</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">226</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">106</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">45</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">22</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">96</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">24</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">143</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">135</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">110</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">86</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">248</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">109</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">5</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">89</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">19</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">79</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">103</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">103</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">83</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">4</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">64</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">11</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">57</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">48</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">3</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">131</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">142</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">37</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">255</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">22</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">8</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">188</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">54</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">226</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">106</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">45</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">22</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">96</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">24</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">143</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">131</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">53</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">207</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">141</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">182</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">125</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">187</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">235</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">225</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">73</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">83</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">104</span>]</div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div class="">When corrupting, I have incremented the bytes at index 1, 48 and 104 respectively by 1.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>