* [FFmpeg-devel] [PATCH 1/2] avcodec/opus: don't materialize buf pointer from null @ 2025-07-03 21:08 Kacper Michajłow 2025-07-03 21:08 ` [FFmpeg-devel] [PATCH] checkasm/swscale: fix function prototypes Kacper Michajłow 2025-07-05 11:23 ` [FFmpeg-devel] [PATCH 1/2] avcodec/opus: don't materialize buf pointer from null Michael Niedermayer 0 siblings, 2 replies; 4+ messages in thread From: Kacper Michajłow @ 2025-07-03 21:08 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Kacper Michajłow Fixes: avcodec/opus/dec.c: runtime error: applying non-zero offset 10 to null pointer Signed-off-by: Kacper Michajłow <kasper93@gmail.com> --- libavcodec/opus/dec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/opus/dec.c b/libavcodec/opus/dec.c index 6c59dc1f46..dbefcddb0c 100644 --- a/libavcodec/opus/dec.c +++ b/libavcodec/opus/dec.c @@ -585,6 +585,9 @@ static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame, s->decoded_samples = ret; decoded_samples = FFMIN(decoded_samples, ret); + if (!buf) + continue; + buf += s->packet.packet_size; buf_size -= s->packet.packet_size; } -- 2.47.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 4+ messages in thread
* [FFmpeg-devel] [PATCH] checkasm/swscale: fix function prototypes 2025-07-03 21:08 [FFmpeg-devel] [PATCH 1/2] avcodec/opus: don't materialize buf pointer from null Kacper Michajłow @ 2025-07-03 21:08 ` Kacper Michajłow 2025-07-16 10:52 ` Kacper Michajlow 2025-07-05 11:23 ` [FFmpeg-devel] [PATCH 1/2] avcodec/opus: don't materialize buf pointer from null Michael Niedermayer 1 sibling, 1 reply; 4+ messages in thread From: Kacper Michajłow @ 2025-07-03 21:08 UTC (permalink / raw) To: ffmpeg-devel; +Cc: Kacper Michajłow This aligns declared function types in checkasm with real definition. Fixes FATE: checkasm-{sw_rgb,sw_scale,sw_yuv2rgb,sw_yuv2yuv} Fixes: runtime error: call to function <func> through pointer to incorrect function type Fixes: c1a0e657638f7007dcc807a2d985c22631fcd6d3 Signed-off-by: Kacper Michajłow <kasper93@gmail.com> --- tests/checkasm/sw_rgb.c | 2 +- tests/checkasm/sw_scale.c | 8 ++++---- tests/checkasm/sw_yuv2rgb.c | 6 +++--- tests/checkasm/sw_yuv2yuv.c | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c index b98c7c6b47..6edfc93b0b 100644 --- a/tests/checkasm/sw_rgb.c +++ b/tests/checkasm/sw_rgb.c @@ -142,7 +142,7 @@ static void check_rgb24toyv12(SwsContext *sws) declare_func(void, const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, - int chromStride, int srcStride, int32_t *rgb2yuv); + int chromStride, int srcStride, const int32_t *rgb2yuv); randomize_buffers(src, BUFSIZE * 3); diff --git a/tests/checkasm/sw_scale.c b/tests/checkasm/sw_scale.c index 11c9174a6b..b91e0b64ed 100644 --- a/tests/checkasm/sw_scale.c +++ b/tests/checkasm/sw_scale.c @@ -362,7 +362,7 @@ static void check_hscale(void) // The dst parameter here is either int16_t or int32_t but we use void* to // just cover both cases. - declare_func(void, void *c, void *dst, int dstW, + declare_func(void, SwsInternal *c, int16_t *dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize); @@ -422,11 +422,11 @@ static void check_hscale(void) memset(dst0, 0, SRC_PIXELS * sizeof(dst0[0])); memset(dst1, 0, SRC_PIXELS * sizeof(dst1[0])); - call_ref(NULL, dst0, sws->dst_w, src, filter, filterPos, width); - call_new(NULL, dst1, sws->dst_w, src, filterAvx2, filterPosAvx, width); + call_ref(NULL, (int16_t *)dst0, sws->dst_w, src, filter, filterPos, width); + call_new(NULL, (int16_t *)dst1, sws->dst_w, src, filterAvx2, filterPosAvx, width); if (memcmp(dst0, dst1, sws->dst_w * sizeof(dst0[0]))) fail(); - bench_new(NULL, dst0, sws->dst_w, src, filter, filterPosAvx, width); + bench_new(NULL, (int16_t *)dst0, sws->dst_w, src, filter, filterPosAvx, width); } } } diff --git a/tests/checkasm/sw_yuv2rgb.c b/tests/checkasm/sw_yuv2rgb.c index c25fb99ca2..c6c1ad934b 100644 --- a/tests/checkasm/sw_yuv2rgb.c +++ b/tests/checkasm/sw_yuv2rgb.c @@ -107,9 +107,9 @@ static void check_yuv2rgb(int src_pix_fmt) static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE}; declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, - int, SwsInternal *c, const uint8_t *src[], - int srcStride[], int srcSliceY, int srcSliceH, - uint8_t *dst[], int dstStride[]); + int, SwsInternal *c, const uint8_t *const src[], + const int srcStride[], int srcSliceY, int srcSliceH, + uint8_t *const dst[], const int dstStride[]); LOCAL_ALIGNED_8(uint8_t, src_y, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_8(uint8_t, src_u, [MAX_LINE_SIZE]); diff --git a/tests/checkasm/sw_yuv2yuv.c b/tests/checkasm/sw_yuv2yuv.c index 6fe8e47d19..6a7a7a8b9a 100644 --- a/tests/checkasm/sw_yuv2yuv.c +++ b/tests/checkasm/sw_yuv2yuv.c @@ -46,9 +46,9 @@ static void check_semiplanar(int dst_pix_fmt) static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE}; declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, - int, SwsInternal *c, const uint8_t *src[], - int srcStride[], int srcSliceY, int srcSliceH, - uint8_t *dst[], int dstStride[]); + int, SwsInternal *c, const uint8_t *const src[], + const int srcStride[], int srcSliceY, int srcSliceH, + uint8_t *const dstParam[], const int dstStride[]); LOCAL_ALIGNED_8(uint8_t, src_y, [MAX_LINE_SIZE * NUM_LINES]); LOCAL_ALIGNED_8(uint8_t, src_uv, [MAX_LINE_SIZE * NUM_LINES * 2]); -- 2.43.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] checkasm/swscale: fix function prototypes 2025-07-03 21:08 ` [FFmpeg-devel] [PATCH] checkasm/swscale: fix function prototypes Kacper Michajłow @ 2025-07-16 10:52 ` Kacper Michajlow 0 siblings, 0 replies; 4+ messages in thread From: Kacper Michajlow @ 2025-07-16 10:52 UTC (permalink / raw) To: ffmpeg-devel On Thu, 3 Jul 2025 at 23:08, Kacper Michajłow <kasper93@gmail.com> wrote: > > This aligns declared function types in checkasm with real definition. > > Fixes FATE: checkasm-{sw_rgb,sw_scale,sw_yuv2rgb,sw_yuv2yuv} > > Fixes: runtime error: call to function <func> through pointer to incorrect function type > Fixes: c1a0e657638f7007dcc807a2d985c22631fcd6d3 > > Signed-off-by: Kacper Michajłow <kasper93@gmail.com> > --- > tests/checkasm/sw_rgb.c | 2 +- > tests/checkasm/sw_scale.c | 8 ++++---- > tests/checkasm/sw_yuv2rgb.c | 6 +++--- > tests/checkasm/sw_yuv2yuv.c | 6 +++--- > 4 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c > index b98c7c6b47..6edfc93b0b 100644 > --- a/tests/checkasm/sw_rgb.c > +++ b/tests/checkasm/sw_rgb.c > @@ -142,7 +142,7 @@ static void check_rgb24toyv12(SwsContext *sws) > > declare_func(void, const uint8_t *src, uint8_t *ydst, uint8_t *udst, > uint8_t *vdst, int width, int height, int lumStride, > - int chromStride, int srcStride, int32_t *rgb2yuv); > + int chromStride, int srcStride, const int32_t *rgb2yuv); > > randomize_buffers(src, BUFSIZE * 3); > > diff --git a/tests/checkasm/sw_scale.c b/tests/checkasm/sw_scale.c > index 11c9174a6b..b91e0b64ed 100644 > --- a/tests/checkasm/sw_scale.c > +++ b/tests/checkasm/sw_scale.c > @@ -362,7 +362,7 @@ static void check_hscale(void) > > // The dst parameter here is either int16_t or int32_t but we use void* to > // just cover both cases. > - declare_func(void, void *c, void *dst, int dstW, > + declare_func(void, SwsInternal *c, int16_t *dst, int dstW, > const uint8_t *src, const int16_t *filter, > const int32_t *filterPos, int filterSize); > > @@ -422,11 +422,11 @@ static void check_hscale(void) > memset(dst0, 0, SRC_PIXELS * sizeof(dst0[0])); > memset(dst1, 0, SRC_PIXELS * sizeof(dst1[0])); > > - call_ref(NULL, dst0, sws->dst_w, src, filter, filterPos, width); > - call_new(NULL, dst1, sws->dst_w, src, filterAvx2, filterPosAvx, width); > + call_ref(NULL, (int16_t *)dst0, sws->dst_w, src, filter, filterPos, width); > + call_new(NULL, (int16_t *)dst1, sws->dst_w, src, filterAvx2, filterPosAvx, width); > if (memcmp(dst0, dst1, sws->dst_w * sizeof(dst0[0]))) > fail(); > - bench_new(NULL, dst0, sws->dst_w, src, filter, filterPosAvx, width); > + bench_new(NULL, (int16_t *)dst0, sws->dst_w, src, filter, filterPosAvx, width); > } > } > } > diff --git a/tests/checkasm/sw_yuv2rgb.c b/tests/checkasm/sw_yuv2rgb.c > index c25fb99ca2..c6c1ad934b 100644 > --- a/tests/checkasm/sw_yuv2rgb.c > +++ b/tests/checkasm/sw_yuv2rgb.c > @@ -107,9 +107,9 @@ static void check_yuv2rgb(int src_pix_fmt) > static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE}; > > declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, > - int, SwsInternal *c, const uint8_t *src[], > - int srcStride[], int srcSliceY, int srcSliceH, > - uint8_t *dst[], int dstStride[]); > + int, SwsInternal *c, const uint8_t *const src[], > + const int srcStride[], int srcSliceY, int srcSliceH, > + uint8_t *const dst[], const int dstStride[]); > > LOCAL_ALIGNED_8(uint8_t, src_y, [MAX_LINE_SIZE * 2]); > LOCAL_ALIGNED_8(uint8_t, src_u, [MAX_LINE_SIZE]); > diff --git a/tests/checkasm/sw_yuv2yuv.c b/tests/checkasm/sw_yuv2yuv.c > index 6fe8e47d19..6a7a7a8b9a 100644 > --- a/tests/checkasm/sw_yuv2yuv.c > +++ b/tests/checkasm/sw_yuv2yuv.c > @@ -46,9 +46,9 @@ static void check_semiplanar(int dst_pix_fmt) > static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE}; > > declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, > - int, SwsInternal *c, const uint8_t *src[], > - int srcStride[], int srcSliceY, int srcSliceH, > - uint8_t *dst[], int dstStride[]); > + int, SwsInternal *c, const uint8_t *const src[], > + const int srcStride[], int srcSliceY, int srcSliceH, > + uint8_t *const dstParam[], const int dstStride[]); > > LOCAL_ALIGNED_8(uint8_t, src_y, [MAX_LINE_SIZE * NUM_LINES]); > LOCAL_ALIGNED_8(uint8_t, src_uv, [MAX_LINE_SIZE * NUM_LINES * 2]); > -- > 2.43.0 > Will merge later today, if there is no objection. - Kacper _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] avcodec/opus: don't materialize buf pointer from null 2025-07-03 21:08 [FFmpeg-devel] [PATCH 1/2] avcodec/opus: don't materialize buf pointer from null Kacper Michajłow 2025-07-03 21:08 ` [FFmpeg-devel] [PATCH] checkasm/swscale: fix function prototypes Kacper Michajłow @ 2025-07-05 11:23 ` Michael Niedermayer 1 sibling, 0 replies; 4+ messages in thread From: Michael Niedermayer @ 2025-07-05 11:23 UTC (permalink / raw) To: FFmpeg development discussions and patches [-- Attachment #1.1: Type: text/plain, Size: 563 bytes --] On Thu, Jul 03, 2025 at 11:08:23PM +0200, Kacper Michajłow wrote: > Fixes: avcodec/opus/dec.c: runtime error: applying non-zero offset 10 to null pointer > > Signed-off-by: Kacper Michajłow <kasper93@gmail.com> > --- > libavcodec/opus/dec.c | 3 +++ > 1 file changed, 3 insertions(+) will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The difference between a dictatorship and a democracy is that every 4 years the population together is allowed to provide 1 bit of input to the government. [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-16 10:52 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2025-07-03 21:08 [FFmpeg-devel] [PATCH 1/2] avcodec/opus: don't materialize buf pointer from null Kacper Michajłow 2025-07-03 21:08 ` [FFmpeg-devel] [PATCH] checkasm/swscale: fix function prototypes Kacper Michajłow 2025-07-16 10:52 ` Kacper Michajlow 2025-07-05 11:23 ` [FFmpeg-devel] [PATCH 1/2] avcodec/opus: don't materialize buf pointer from null Michael Niedermayer
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git