Re: [FFmpeg-devel] [PATCH] avformat/utils: fix undefined behaviour

2021-02-14 Thread James Almer
On 2/14/2021 6:36 PM, Andreas Rheinhardt wrote: James Almer: On 2/14/2021 6:23 PM, Andreas Rheinhardt wrote: James Almer: On 2/14/2021 6:09 PM, Paul B Mahol wrote: Fixes following report: libavformat/utils.c:1429:14: runtime error: applying zero offset to null pointer How is data NULL here?

Re: [FFmpeg-devel] [PATCH] avformat/utils: fix undefined behaviour

2021-02-14 Thread Andreas Rheinhardt
James Almer: > On 2/14/2021 6:23 PM, Andreas Rheinhardt wrote: >> James Almer: >>> On 2/14/2021 6:09 PM, Paul B Mahol wrote: Fixes following report: libavformat/utils.c:1429:14: runtime error: applying zero offset to null pointer >>> >>> How is data NULL here? That's the input packet

Re: [FFmpeg-devel] [PATCH] avformat/utils: fix undefined behaviour

2021-02-14 Thread James Almer
On 2/14/2021 6:23 PM, Andreas Rheinhardt wrote: James Almer: On 2/14/2021 6:09 PM, Paul B Mahol wrote: Fixes following report: libavformat/utils.c:1429:14: runtime error: applying zero offset to null pointer How is data NULL here? That's the input packet's data pointer, and this loop is acces

Re: [FFmpeg-devel] [PATCH] avformat/utils: fix undefined behaviour

2021-02-14 Thread Andreas Rheinhardt
James Almer: > On 2/14/2021 6:09 PM, Paul B Mahol wrote: >> Fixes following report: >> libavformat/utils.c:1429:14: runtime error: applying zero offset to >> null pointer > > How is data NULL here? That's the input packet's data pointer, and this > loop is accessed only if size is > 0. data == NUL

Re: [FFmpeg-devel] [PATCH] avformat/utils: fix undefined behaviour

2021-02-14 Thread James Almer
On 2/14/2021 6:09 PM, Paul B Mahol wrote: Fixes following report: libavformat/utils.c:1429:14: runtime error: applying zero offset to null pointer How is data NULL here? That's the input packet's data pointer, and this loop is accessed only if size is > 0. data == NULL and size != 0 doesn't s

[FFmpeg-devel] [PATCH] avformat/utils: fix undefined behaviour

2021-02-14 Thread Paul B Mahol
Fixes following report: libavformat/utils.c:1429:14: runtime error: applying zero offset to null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libavformat/utils.c:1429:14 Signed-off-by: Paul B Mahol --- libavformat/utils.c | 6 -- 1 file changed, 4 insertions(+), 2 deletio