On Mon, 4 Apr 2016, [email protected] wrote:
From: Jan Sebechlebsky <[email protected]> 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 [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
