[FFmpeg-devel] [PATCH]lavf/nutenc: Do not call memcmp() with NULL argument

Michael Niedermayer michael at niedermayer.cc
Tue Jul 2 11:49:19 EEST 2019


On Tue, Jul 02, 2019 at 08:29:34AM +0200, Reimar Döffinger wrote:
> On 01.07.2019, at 01:12, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> > Undefined behaviour was reported in ticket #7981, attached patch tries
> > to fix it.
> 
> I suspect it makes more sense to check header_len against 0?

I suggest to check fc->header_idx against 0 because its simpler no
array dereference, would have said that yesterday had my ISP functioned


> And is the NULL pointer really undefined behaviour even if length is 0?

AFAIK yes. (if thats not so alot of people would have said wrong things)
i didnt double check it with the spec though now

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"I am not trying to be anyone's saviour, I'm trying to think about the
 future and not be sad" - Elon Musk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190702/55776bf6/attachment.sig>


More information about the ffmpeg-devel mailing list