diff --git a/src/osgPlugins/gif/ReaderWriterGIF.cpp b/src/osgPlugins/gif/ReaderWriterGIF.cpp index a45644ea1..45210005f 100644 --- a/src/osgPlugins/gif/ReaderWriterGIF.cpp +++ b/src/osgPlugins/gif/ReaderWriterGIF.cpp @@ -546,6 +546,10 @@ GifImageStream** obj) } while (recordtype != TERMINATE_RECORD_TYPE); + // Delete the last allocated buffer to avoid memory leaks if we using GifImageStream + if ( obj && *obj ) + delete [] buffer; + delete [] rowdata; *width_ret = giffile->SWidth; *height_ret = giffile->SHeight;