Re: your mail

Gerd Knorr
2004-01-05T15:25:38Z

> ....
> while (voffset >= sg_dma_len(vsg)) {
> voffset -= sg_dma_len(vsg);
> vsg++;
> }
> ....

> I suspect the problem is that
>
> "voffset >= sg_dma_len(vsg)"
>
> test: if "voffset" is _exactly_ the same as sg_dma_len(), then we will
> test one more iteration (when "voffset" is 0), and that iteration may be
> past the end of the "vsg" array.

That certainly makes sense, the 'v' plane is the last one in the memory
block for the video frame to be captured, so voffset / vsg will walk to
the last sg entry and may overrun described. Good catch, I'm impressed.

> I suspect the fix might be to change the test to
>
> "voffset && voffset >= sg_dma_len(vsg)"

Merged into my tree, thanks.

still busy with the xmas mail backlog,

Gerd