[linux-dvb] [PATCH] 1/3: BUG FIX in dvb_ringbuffer_flush

Andrea mariofutire at googlemail.com
Sat Mar 22 01:22:06 CET 2008

I've been playing with DMX_SET_BUFFER_SIZE and I've had a problem when I tried to resize the buffer
to a smaller size.

dvb_dmxdev_set_buffer_size flushes the ringbuffer and then replaces it with a new one.
What happens if the current pointer is on a position that would be invalid in the new buffer? An
access violation.

This because dvb_ringbuffer_flush resets the 2 pointers to the vaule of pwrite (which could be after
the end of the new buffer).
I think it is safer to reset them to 0.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ring.diff
Type: text/x-patch
Size: 454 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20080322/58917414/attachment.bin 

More information about the linux-dvb mailing list