On Mon, 4 Apr 2016, sebechlebsky...@gmail.com wrote:
From: Jan Sebechlebsky <sebechlebsky...@gmail.com> Calling close_slave in case error is to be returned from open_slave will free allocated resources. Since failure can happen before bsfs array is initialized, close_slave must check that bsfs is not NULL before accessing tee_slave->bsfs[i] element.
I noticed a problem. tee->nb_slaves is only assigned after opening all slaves, so if any of the open_slave call fails, tee->nb_slaves will still be 0, so no resources will get freed.
On the other hand, if you move the assignment before the open_slave loop, you will also have to handle the case in close_slaves when tee_slave->avf is null, or you have to increase tee->nb_slaves incrementally in the loop...
Regards, Marton _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel