CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/11/12 15:16:28
Modified files: . : ChangeLog server/asobj : SoundFfmpeg.cpp Log message: (getAudio): don't delete allocated memory twice. Fixes bug #21195. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4834&r2=1.4835 http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/SoundFfmpeg.cpp?cvsroot=gnash&r1=1.14&r2=1.15 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4834 retrieving revision 1.4835 diff -u -b -r1.4834 -r1.4835 --- ChangeLog 12 Nov 2007 13:11:44 -0000 1.4834 +++ ChangeLog 12 Nov 2007 15:16:27 -0000 1.4835 @@ -1,5 +1,7 @@ 2007-11-12 Sandro Santilli <[EMAIL PROTECTED]> + * server/asobj/SoundFfmpeg.cpp (getAudio): don't delete + allocated memory twice. Fixes bug #21195. * gui/gnash.in: Add support for -G list for getting a list of available guis. Index: server/asobj/SoundFfmpeg.cpp =================================================================== RCS file: /sources/gnash/gnash/server/asobj/SoundFfmpeg.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -b -r1.14 -r1.15 --- server/asobj/SoundFfmpeg.cpp 27 Jul 2007 15:09:41 -0000 1.14 +++ server/asobj/SoundFfmpeg.cpp 12 Nov 2007 15:16:27 -0000 1.15 @@ -269,6 +269,7 @@ int samples = stereo ? frame_size >> 2 : frame_size >> 1; int newDataSize = 0; int16_t* output_data = NULL; + bool output_data_allocated = false; // Resample if needed if (so->audioCodecCtx->channels != 2 || so->audioCodecCtx->sample_rate != 44100) { @@ -279,6 +280,7 @@ } // The size of this is a guess, we don't know yet... Lets hope it's big enough output_data = new int16_t[AVCODEC_MAX_AUDIO_FRAME_SIZE]; + output_data_allocated = true; samples = audio_resample (so->resampleCtx, output_data, (int16_t*)ptr, samples); newDataSize = samples * 2 * 2; // 2 for stereo and 2 for samplesize = 2 bytes } else { @@ -303,7 +305,7 @@ loop = false; pos += rest; } - delete[] output_data; + if ( output_data_allocated ) delete[] output_data; } } } _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit