Re: [FFmpeg-devel] [PATCH] libavcodec/h264dec: avoid arithmetic on null pointers

2023-03-02 Thread Jeremy Dorfman
On Thu, Mar 2, 2023 at 6:37 AM James Almer wrote: > > On 3/2/2023 8:33 AM, James Almer wrote: > > On 3/2/2023 6:05 AM, Anton Khirnov wrote: > >> Quoting Jeremy Dorfman (2023-03-01 19:50:08) > >>> null pointer arithmetic is undefined behavior in C. > >

Re: [FFmpeg-devel] [PATCH] libavcodec/h264dec: avoid arithmetic on null pointers

2023-03-01 Thread Jeremy Dorfman
On Wed, Mar 1, 2023 at 3:22 PM Jeremy Dorfman wrote: > > On Wed, Mar 1, 2023 at 2:07 PM James Almer wrote: > > > > On 3/1/2023 3:50 PM, Jeremy Dorfman wrote: > > > null pointer arithmetic is undefined behavior in C. > > > --- > > > libavcodec

Re: [FFmpeg-devel] [PATCH] libavcodec/h264dec: avoid arithmetic on null pointers

2023-03-01 Thread Jeremy Dorfman
On Wed, Mar 1, 2023 at 2:07 PM James Almer wrote: > > On 3/1/2023 3:50 PM, Jeremy Dorfman wrote: > > null pointer arithmetic is undefined behavior in C. > > --- > > libavcodec/h264dec.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > >

[FFmpeg-devel] [PATCH] libavcodec/h264dec: avoid arithmetic on null pointers

2023-03-01 Thread Jeremy Dorfman
null pointer arithmetic is undefined behavior in C. --- libavcodec/h264dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 2d691731c5..ef698f2630 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -912,8 +912,

[FFmpeg-devel] [PATCH] swscale/input: Use unsigned intermediates in rgb64ToUV_c_template

2022-11-15 Thread Jeremy Dorfman
Large rgb2yuv tables and high pixel values cause the intermediate int32_t of ru*r + gu*g + bu*b to exceed INT_MAX, which is undefined behavior. This causes libswscale built with LLVM -fsanitize=undefined to assert. Using unsigned integers instead has defined behavior and produces identical results,

Re: [FFmpeg-devel] [PATCH] avformat/av1: Initialize padding in ff_isom_write_av1c

2019-04-08 Thread Jeremy Dorfman via ffmpeg-devel
ck as uninitialized, so I don't think this is a false positive -- it doesn't appear to ever be intentionally written. Thanks, -Jeremy On Mon, Apr 8, 2019 at 9:33 AM James Almer wrote: > On 4/8/2019 9:14 AM, Jeremy Dorfman via ffmpeg-devel wrote: > > Otherwise, AV1 encodes wi

[FFmpeg-devel] [PATCH] avformat/av1: Initialize padding in ff_isom_write_av1c

2019-04-08 Thread Jeremy Dorfman via ffmpeg-devel
Otherwise, AV1 encodes with FFmpeg trigger use-of-uninitialized-value warnings under MemorySanitizer, and the output buffer potentially changes from run to run. --- libavformat/av1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/av1.c b/libavformat/av1.c index a0aad436a6..5fde8df