Re: [libav-devel] [PATCH] mov: Avoid memcmp of uninitialised data
On 29/01/17 22:54, Henrik Gramner wrote: > On Sun, Jan 29, 2017 at 8:59 PM, Mark Thompsonwrote: >> strncmp > > Any particular reason for not just using plain strcmp()? That would change the semantics: 'memcmp(codec_name, "Sorenson H263", 13)' admits the possibility that the string is "Sorenson H263 and also some other stuff", but strcmp would disallow that. I'm not familiar enough with the code to declare whether that is intended, so I used strncmp to keep it identical (really I was only wanting to remove the valgrind warning which annoyed me). ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] mov: Avoid memcmp of uninitialised data
On Sun, Jan 29, 2017 at 8:59 PM, Mark Thompsonwrote: > strncmp Any particular reason for not just using plain strcmp()? ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] mov: Avoid memcmp of uninitialised data
On Sun, Jan 29, 2017 at 07:59:22PM +, Mark Thompson wrote: > The string codec name need not be as long as the value we are > comparing it to, so memcmp may make decisions derived from > uninitialised data that valgrind then complains about (though the > overall result of the function will always be the same). Use > strncmp instead, which will stop at the first zero byte and > therefore not encounter this issue. > --- > libavformat/mov.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) probably OK Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel