avifil32: Fix some memory leaks

Kuba Ober kuba at mareimbrium.org
Thu Sep 13 08:45:53 CDT 2007


On Wednesday 12 September 2007, Paul Vriens wrote:
> Andrew Talbot wrote:
> > Changelog:
> >     avifil32: Fix some memory leaks.
> >
> >
> > -    if (mmioSeek(This->paf->hmmio, This->paf->dwNextFramePos, SEEK_SET)
> > == -1) -      return AVIERR_FILEWRITE;
> > -    if (mmioCreateChunk(This->paf->hmmio, &ck, 0) != S_OK)
> > -      return AVIERR_FILEWRITE;
> > -    if (mmioWrite(This->paf->hmmio, (HPSTR)lppc, ck.cksize) !=
> > ck.cksize) -      return AVIERR_FILEWRITE;
> > -    if (mmioAscend(This->paf->hmmio, &ck, 0) != S_OK)
> > +    if (mmioSeek(This->paf->hmmio, This->paf->dwNextFramePos, SEEK_SET)
> > == -1 || +        mmioCreateChunk(This->paf->hmmio, &ck, 0) != S_OK ||
> > +        mmioWrite(This->paf->hmmio, (HPSTR)lppc, ck.cksize) != ck.cksize
> > || +        mmioAscend(This->paf->hmmio, &ck, 0) != S_OK)
> > +    {
>
> Doesn't this mean that every one of those 4 mmio-calls are executed? In the
> previous logic we would bail out after one failure.

No. They are evaluated left-to-right, and evaluation stops on the first one 
returning true.

Cheers, Kuba



More information about the wine-devel mailing list