[ogg-dev] liboggplay: RGBA overlay video, rendering with libtiger

Chris Double chris.double at double.co.nz
Mon Dec 15 16:33:08 PST 2008


On Tue, Dec 16, 2008 at 1:22 PM, ogg.k.ogg.k at googlemail.com
<ogg.k.ogg.k at googlemail.com> wrote:
>> In oggplay.c there are checks like the following that do 'track >=
>> me->num_tracks' and at least one that does 'track > me->num_tracks'. I
>> think it should be '>' not '>=' in all cases, what do you think? Code
>
> I think it should be >= all the time. I'll check those out.

Yes, >= is correct. It's oggplay_set_offset that seems to have it wrong.

-----------------8<-----------------
  if (track <= 0 || track > me->num_tracks) {
    return E_OGGPLAY_BAD_TRACK;
  }

  me->decode_data[track]->offset = (offset << 32);
-----------------8<-----------------

It indexes into decode_data using the track. decode_data is allocated
in oggplay_callback.c:

  me->decode_data = realloc (me->decode_data, sizeof (long) * me->num_tracks);

Indexing by the value of num_tracks would be an error.

Chris.


More information about the ogg-dev mailing list