[Theora-dev] decoder init/clear

Michael Smith mlrsmith at gmail.com
Fri Aug 5 02:39:19 PDT 2005


On 8/5/05, Conrad Parker <conrad at metadecks.org> wrote:
> Enabling the following function in tests/noop.c:
> So, I think a baseline test like this noop one is useful in order to
> check that setup and teardown of the data structures works reliably. Once
> we know that the setup works reliably, we can narrow down problems in the
> actual functionality.
> 
> Thoughts? Do we fix the test or the library? ;-)

Where practical, I think the library shouldn't crash due to bad input.
 Fix the library.

That's often going to be hard, though - there are limits to what we
can do in the presence of arbitrary uninitialised data, as in your
second example (with theora_info_init() removed)

This is one reason why functions like theora_info_init() would be
better replaced with something more like theora_info_create(), which
would actually allocate the function. In such a case we'd then either
get a NULL pointer (easily detected; can return an error code), a good
pointer (fine), or a bad pointer (again, nothing we could reasonably
do about that).

theora_decode_init() shouldn't be crashing solely due to not having a
fully initialised theora_info, though - that's a case we can detect
without too much hassle.

Mike


More information about the Theora-dev mailing list