[FFmpeg-devel] [PATCH V2] avutil/tx: add check against (*ctx)
Nicolas George
george at nsup.org
Thu May 16 17:30:06 EEST 2019
John Cox (12019-05-16):
> >> - if (!ctx)
> >> + if (!ctx || !(*ctx))
> >That would protect somebody stupid enough to call av_tx_uninit(NULL)
> >instead of av_tx_uninit(&var). A hard crass is completely warranted in
> >this case. An assert would be acceptable.
> Actually that is what the original code does. What you appear to want
> is
>
> if (!*ctx)
Indeed.
It is for example what avfilter_link_free(), av_bsf_list_free(), etc.,
do. It correspond to a useful programming pattern. The current code is
clearly a mistake.
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190516/2f28a3ec/attachment.sig>
More information about the ffmpeg-devel
mailing list