[Libreoffice] [PATCH] proposed fix for fdo#44533

julien2412 serval2412 at yahoo.fr
Sun Jan 8 14:19:32 PST 2012


Hello,

I attached a patch for fdo#44533 (SLIDESHOW: CRASH when play particular
presentation with sound).
I attached in the bugtracker the backtrace
(https://bugs.freedesktop.org/attachment.cgi?id=55314)
and console logs (https://bugs.freedesktop.org/attachment.cgi?id=55315)

Here is the code :
        VectorOfSprites::iterator aBegin( aUpdatableSprites.begin() );
        VectorOfSprites::iterator aEnd  ( aUpdatableSprites.end() );
        ::std::sort( aBegin,
                     aEnd,
                     aSpriteComparator );

        aEnd = ::std::unique( aBegin, aEnd );

...comments   
     ::std::for_each( aBegin,
                         aEnd,
                         SpriteUpdater( rUpdateAreas,
                                        maChangeRecords) );

 ...comments
       VectorOfSprites aUnchangedSprites;
        ::std::set_difference( aSortedSpriteVector.begin(),
                               aSortedSpriteVector.end(),
                               aBegin, aEnd,
                               ::std::back_insert_iterator< VectorOfSprites
>(aUnchangedSprites) );

Because of the sort, I don't think that the iterators aBegin and aEnd can be
reused just after a sort.
So i try to declare these variables after the sort and I didn't have a
crash.

Perhaps, these variables could be declared more lately for safety or perhaps
not at all (and so we should call each time .begin and .end each time), I'm
not sure.

Any idea ?
Julien

http://nabble.documentfoundation.org/file/n3643134/proposed_patch_44533.txt
proposed_patch_44533.txt  

--
View this message in context: http://nabble.documentfoundation.org/PATCH-proposed-fix-for-fdo-44533-tp3643134p3643134.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list