On 22/05/2019 02:04, Andreas Rheinhardt wrote:
> There is no danger of leaving dangling pointers behind, as the lifespan
> of local variables (including pointers passed (by value) as function
> arguments) ends anyway as soon as we exit their scope.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com>
> ---
>  libavcodec/cbs.c       | 2 +-
>  libavcodec/cbs_jpeg.c  | 8 ++++----
>  libavcodec/cbs_mpeg2.c | 4 ++--
>  3 files changed, 7 insertions(+), 7 deletions(-)

I don't agree with the premise of this patch.  I think it's sensible to use 
av_freep() everywhere, because the marginal cost over av_free() is ~zero and it 
makes some possible use-after-free errors easier to find.  (While all of these 
do appear just before the containing functions return, in general it's not 
useful to even need to think about that.)

- Mark
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to