Re: your mail

From: Gerd Knorr
Date: Mon Jan 05 2004 - 10:27:11 EST


> ....
> 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/