[haiku-commits] Re: haiku: hrev49620 - src/kits/interface src/servers/app headers/private/interface

  • From: Michael Lotz <mmlr@xxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 07 Sep 2015 13:30:04 +0200

On 09/07/2015 12:29 PM, marcus overhagen wrote:

On Sat, Sep 5, 2015 at 4:11 PM, <mmlr@xxxxxxxx> wrote:

case B_PIC_SET_STIPLE_PATTERN:
{
+ const pattern* stipplePattern;
+ if (callbacks.set_stipple_pattern == NULL
+ || !reader.Get(stipplePattern)) {
+ break;
+ }
+
+ callbacks.set_stipple_pattern(userData,
*stipplePattern);
break;
}

Although it is save, playback of the picture is completely aborted as
soon as any of the callbacks is zero,
because the parameters won't be read and any further data that is read is wrong.
I would change this to always get the parameters first, and then test
for callback availablity.

Nope, the reader in this case is a local "op" reader, attached to the op buffer, i.e. the part of the buffer following the op header with a length of header->size. The pictureReader is the one attached to the whole buffer. That's the one reading the tagged stream, skipping over any unused/unread parts within the individual ops or over whole unsupported ops.

Regards,
Michael


Other related posts: