[FFmpeg-devel] [PATCH] oops I broke rdt.c

Ronald S. Bultje rsbultje
Wed Dec 17 14:33:52 CET 2008


On Tue, Dec 16, 2008 at 1:38 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> st->id is
> ensured (I can assert() that if you wish) to be st->index -
> first_st_of_set->index and therefore automatically is always smaller
> than MAX_STREAMS, and is more specifically within the range of 0 and
> RDTDemuxContext->n_streams. I think the assert() would be the easiest
> way to ensure this / make it clear without making the code more
> complex.

See attached. s->prev_stream_id is checked just 5 lines up to be <
s->n_streams and is assigned in ff_rdt_parse_header() as either a
5-bits or a 16-bits (if the 5-bits is 0x1f) unsigned integer, and is
thus guaranteed to be >=0. Therefore, st->id is within the same range.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rdt-add-st_id-assert.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081217/5dda3e48/attachment.txt>

More information about the ffmpeg-devel mailing list