Re: [FFmpeg-devel] [PATCH 2/2] configure: Use -fno-sanitize-recover

2025-01-17 Thread Vitaly Buka via ffmpeg-devel
My confusion here is that it looks like ffmpeg developers care about UB, I
see from time to time large cleanups, but there are a bunch of unfixed
reports.
Maybe forcing no-recover by default will improve this situation?


On Fri, Jan 17, 2025 at 11:57 AM Frank Plowman 
wrote:

> On 16/01/2025 19:12, Vitaly Buka via ffmpeg-devel wrote:
> > UBSAN by default is just prints a mesage and
> > moves on. This hides a few UBs in fate-suite.
> >
> > Signed-off-by: Vitaly Buka 
> > ---
> >  configure | 4 ++--
> >  libavcodec/aacenc_pred.c  | 1 +
> >  libavcodec/ffv1dec.c  | 1 +
> >  libavcodec/ffv1enc_template.c | 1 +
> >  libavcodec/get_bits.h | 1 +
> >  libavcodec/indeo3.c   | 2 +-
> >  libavcodec/motion_est.c   | 1 +
> >  libavcodec/mss2dsp.c  | 1 +
> >  libavcodec/opus/dec.c | 1 +
> >  libavcodec/snow.h | 1 +
> >  libavcodec/svq1enc.c  | 1 +
> >  libavfilter/vf_curves.c   | 1 +
> >  libavfilter/vf_overlay.c  | 1 +
> >  libavformat/mov.c | 1 +
> >  libswscale/input.c| 6 ++
> >  libswscale/output.c   | 4 
> >  libswscale/swscale_unscaled.c | 3 +++
> >  17 files changed, 28 insertions(+), 3 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 3a1e72e1c6..f2b4fd2c62 100755
> > --- a/configure
> > +++ b/configure
> > @@ -4568,7 +4568,7 @@ set >> $logfile
> >  test -n "$valgrind" && toolchain="valgrind-memcheck"
> >
> >  enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize="  && ! echo
> $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
> > -add_cflags  -fsanitize=address,undefined
> -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
> > +add_cflags  -fsanitize=address,undefined
> -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
> -fno-sanitize-recover=all
> >  add_ldflags -fsanitize=address,undefined
> -fsanitize-coverage=trace-pc-guard,trace-cmp
> >  }
> >
> > @@ -4591,7 +4591,7 @@ add_sanitizer_flags(){
> >  add_ldflags -fsanitize=thread
> >  ;;
> >  usan)
> > -add_cflags  -fsanitize=undefined
> > +add_cflags  -fsanitize=undefined -fno-sanitize-recover=all
>
> I agree it would be good to return a nonzero exit code on detecting
> undefined behaviour when running FATE, but this sets the flag for any
> --toolchain=*-usan configuration.  Personally, I would find it a little
> unexpected that compiling with --toolchain=*-usan results in anything
> but the default behaviour of UBSAN, and one might wish to use UBSAN
> without the flag when testing manually.  As an alternative, what about
> instead setting UBSAN_OPTIONS=halt_on_error=1 only when running the FATE
> suite or fuzzing?
>
> --
> Frank
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] configure: Use -fno-sanitize-recover

2025-01-17 Thread Vitaly Buka via ffmpeg-devel
On Fri, Jan 17, 2025 at 3:12 PM James Almer  wrote:

> On 1/17/2025 7:53 PM, Vitaly Buka via ffmpeg-devel wrote:
> > My confusion here is that it looks like ffmpeg developers care about UB,
> I
> > see from time to time large cleanups, but there are a bunch of unfixed
> > reports.
> > Maybe forcing no-recover by default will improve this situation?
>
> It will not change much because the FATE clients currently running with
> gcc ubsan both manually add this extra option, but with undefined as
> argument rather than all. See
>
> https://fate.ffmpeg.org/report.cgi?time=20250117151351&slot=x86_64-archlinux-gcc-ubsan
>
> Like i said, I'm not against adding this extra option, but I'm against
> adding all the exceptions scattered around the code.
>
>
Sorry. Looks like I fixed my email delivery after your reply.
I can see it in the archive now:

> Adding this is probably fine, but all the exceptions below to ignore
issues are not ok.

Does this mean we need to fix those issues first?
Is it acceptable to make FATE stop passing with UBSAN?

Most of them are relatively straight forward, but I failed to quick-guess
some, like "bounds" one.



> >
> >
> > On Fri, Jan 17, 2025 at 11:57 AM Frank Plowman 
> > wrote:
> >
> >> On 16/01/2025 19:12, Vitaly Buka via ffmpeg-devel wrote:
> >>> UBSAN by default is just prints a mesage and
> >>> moves on. This hides a few UBs in fate-suite.
> >>>
> >>> Signed-off-by: Vitaly Buka 
> >>> ---
> >>>   configure | 4 ++--
> >>>   libavcodec/aacenc_pred.c  | 1 +
> >>>   libavcodec/ffv1dec.c  | 1 +
> >>>   libavcodec/ffv1enc_template.c | 1 +
> >>>   libavcodec/get_bits.h | 1 +
> >>>   libavcodec/indeo3.c   | 2 +-
> >>>   libavcodec/motion_est.c   | 1 +
> >>>   libavcodec/mss2dsp.c  | 1 +
> >>>   libavcodec/opus/dec.c | 1 +
> >>>   libavcodec/snow.h | 1 +
> >>>   libavcodec/svq1enc.c  | 1 +
> >>>   libavfilter/vf_curves.c   | 1 +
> >>>   libavfilter/vf_overlay.c  | 1 +
> >>>   libavformat/mov.c | 1 +
> >>>   libswscale/input.c| 6 ++
> >>>   libswscale/output.c   | 4 
> >>>   libswscale/swscale_unscaled.c | 3 +++
> >>>   17 files changed, 28 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/configure b/configure
> >>> index 3a1e72e1c6..f2b4fd2c62 100755
> >>> --- a/configure
> >>> +++ b/configure
> >>> @@ -4568,7 +4568,7 @@ set >> $logfile
> >>>   test -n "$valgrind" && toolchain="valgrind-memcheck"
> >>>
> >>>   enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize="  && !
> echo
> >> $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
> >>> -add_cflags  -fsanitize=address,undefined
> >> -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
> >>> +add_cflags  -fsanitize=address,undefined
> >> -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
> >> -fno-sanitize-recover=all
> >>>   add_ldflags -fsanitize=address,undefined
> >> -fsanitize-coverage=trace-pc-guard,trace-cmp
> >>>   }
> >>>
> >>> @@ -4591,7 +4591,7 @@ add_sanitizer_flags(){
> >>>   add_ldflags -fsanitize=thread
> >>>   ;;
> >>>   usan)
> >>> -add_cflags  -fsanitize=undefined
> >>> +add_cflags  -fsanitize=undefined -fno-sanitize-recover=all
> >>
> >> I agree it would be good to return a nonzero exit code on detecting
> >> undefined behaviour when running FATE, but this sets the flag for any
> >> --toolchain=*-usan configuration.  Personally, I would find it a little
> >> unexpected that compiling with --toolchain=*-usan results in anything
> >> but the default behaviour of UBSAN, and one might wish to use UBSAN
> >> without the flag when testing manually.  As an alternative, what about
> >> instead setting UBSAN_OPTIONS=halt_on_error=1 only when running the FATE
> >> suite or fuzzing?
> >>
> >> --
> >> Frank
> >>
> >> ___
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel@ffmpeg.org
> >> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >> To unsubscribe, visit link above, or email
> >> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> >>
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/hevc/hevcdec: Don't add to null pointer

2025-01-29 Thread Vitaly Buka via ffmpeg-devel
Hello,

Would it be possible to merge this patch?

Thanks,
Vitaly
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 2/2] configure: Use -fno-sanitize-recover

2025-01-16 Thread Vitaly Buka via ffmpeg-devel
UBSAN by default is just prints a mesage and
moves on. This hides a few UBs in fate-suite.

Signed-off-by: Vitaly Buka 
---
 configure | 4 ++--
 libavcodec/aacenc_pred.c  | 1 +
 libavcodec/ffv1dec.c  | 1 +
 libavcodec/ffv1enc_template.c | 1 +
 libavcodec/get_bits.h | 1 +
 libavcodec/indeo3.c   | 2 +-
 libavcodec/motion_est.c   | 1 +
 libavcodec/mss2dsp.c  | 1 +
 libavcodec/opus/dec.c | 1 +
 libavcodec/snow.h | 1 +
 libavcodec/svq1enc.c  | 1 +
 libavfilter/vf_curves.c   | 1 +
 libavfilter/vf_overlay.c  | 1 +
 libavformat/mov.c | 1 +
 libswscale/input.c| 6 ++
 libswscale/output.c   | 4 
 libswscale/swscale_unscaled.c | 3 +++
 17 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 3a1e72e1c6..f2b4fd2c62 100755
--- a/configure
+++ b/configure
@@ -4568,7 +4568,7 @@ set >> $logfile
 test -n "$valgrind" && toolchain="valgrind-memcheck"
 
 enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize="  && ! echo 
$CFLAGS | grep -q -- "-fcoverage-mapping" &&{
-add_cflags  -fsanitize=address,undefined 
-fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
+add_cflags  -fsanitize=address,undefined 
-fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer 
-fno-sanitize-recover=all
 add_ldflags -fsanitize=address,undefined 
-fsanitize-coverage=trace-pc-guard,trace-cmp
 }
 
@@ -4591,7 +4591,7 @@ add_sanitizer_flags(){
 add_ldflags -fsanitize=thread
 ;;
 usan)
-add_cflags  -fsanitize=undefined
+add_cflags  -fsanitize=undefined -fno-sanitize-recover=all
 add_ldflags -fsanitize=undefined
 ;;
 ?*)
diff --git a/libavcodec/aacenc_pred.c b/libavcodec/aacenc_pred.c
index a486c44d42..9fd119852c 100644
--- a/libavcodec/aacenc_pred.c
+++ b/libavcodec/aacenc_pred.c
@@ -148,6 +148,7 @@ static inline int update_counters(IndividualChannelStream 
*ics, int inc)
 return 0;
 }
 
+__attribute__((no_sanitize("bounds")))  // FIXME: Remove.
 void ff_aac_adjust_common_pred(AACEncContext *s, ChannelElement *cpe)
 {
 int start, w, w2, g, i, count = 0;
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 7845815873..c0e29dcac1 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -263,6 +263,7 @@ static void slice_set_damaged(FFV1Context *f, 
FFV1SliceContext *sc)
 f->frame_damaged = 1;
 }
 
+__attribute__((no_sanitize("pointer-overflow")))  // FIXME: Remove.
 static int decode_slice(AVCodecContext *c, void *arg)
 {
 FFV1Context *f= c->priv_data;
diff --git a/libavcodec/ffv1enc_template.c b/libavcodec/ffv1enc_template.c
index bc14926ab9..786402b9f7 100644
--- a/libavcodec/ffv1enc_template.c
+++ b/libavcodec/ffv1enc_template.c
@@ -22,6 +22,7 @@
 
 #include "ffv1_template.c"
 
+__attribute__((no_sanitize("pointer-overflow")))  // FIXME: Remove.
 static av_always_inline int
 RENAME(encode_line)(FFV1Context *f, FFV1SliceContext *sc,
 void *logctx,
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index fe2f6378b4..7829a8ce1b 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -511,6 +511,7 @@ static inline unsigned int show_bits_long(GetBitContext *s, 
int n)
  * @param bit_size the size of the buffer in bits
  * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
  */
+__attribute__((no_sanitize("pointer-overflow")))  // FIXME: Remove.
 static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
 int bit_size)
 {
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index fbabd4b6ad..bd976f2854 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -427,7 +427,7 @@ if (*data_ptr >= last_ptr) \
  (AV_RN16(dst + row_offset + 2) + delta_tab->deltas[dyad2]) & 
0x7F7F);\
 }
 
-
+__attribute__((no_sanitize("pointer-overflow")))  // FIXME: Remove.
 static int decode_cell_data(Indeo3DecodeContext *ctx, Cell *cell,
 uint8_t *block, uint8_t *ref_block,
 ptrdiff_t row_offset, int h_zoom, int v_zoom, int 
mode,
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index e4f17fb2d8..d618425a44 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -79,6 +79,7 @@ static int minima_cmp(const void *a, const void *b){
 #define FLAG_CHROMA 2
 #define FLAG_DIRECT 4
 
+__attribute__((no_sanitize("pointer-overflow")))  // FIXME: Remove.
 static inline void init_ref(MotionEstContext *c, uint8_t *const src[3],
 uint8_t *const ref[3], uint8_t *const ref2[3],
 int x, int y, int ref_index)
diff --git a/libavcodec/mss2dsp.c b/libavcodec/mss2dsp.c
index cc39dd637f..90fe325647 100644
--- a/libavcodec/mss2dsp.c
+++ b/libavcodec/mss2dsp.c
@@ -26,6 +26,7 @@
 #include "mss2dsp.h"

[FFmpeg-devel] [PATCH 1/2] .gitignore: ignore fate-suite

2025-01-16 Thread Vitaly Buka via ffmpeg-devel
Signed-off-by: Vitaly Buka 
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 9cfc78b414..6fcbddad3c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,3 +43,4 @@
 /tools/python/__pycache__/
 /libavcodec/vulkan/*.c
 /libavfilter/vulkan/*.c
+/fate-suite/
-- 
2.48.0.rc2.279.g1de40edade-goog

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] configure: Use -fno-sanitize-recover

2025-01-16 Thread Vitaly Buka via ffmpeg-devel
I assume "recover" mode is there unintentionally.
"-fno-sanitize-recover" helps to keep the code clean.

On Thu, Jan 16, 2025 at 11:13 AM Vitaly Buka  wrote:

> UBSAN by default is just prints a mesage and
> moves on. This hides a few UBs in fate-suite.
>
> Signed-off-by: Vitaly Buka 
> ---
>  configure | 4 ++--
>  libavcodec/aacenc_pred.c  | 1 +
>  libavcodec/ffv1dec.c  | 1 +
>  libavcodec/ffv1enc_template.c | 1 +
>  libavcodec/get_bits.h | 1 +
>  libavcodec/indeo3.c   | 2 +-
>  libavcodec/motion_est.c   | 1 +
>  libavcodec/mss2dsp.c  | 1 +
>  libavcodec/opus/dec.c | 1 +
>  libavcodec/snow.h | 1 +
>  libavcodec/svq1enc.c  | 1 +
>  libavfilter/vf_curves.c   | 1 +
>  libavfilter/vf_overlay.c  | 1 +
>  libavformat/mov.c | 1 +
>  libswscale/input.c| 6 ++
>  libswscale/output.c   | 4 
>  libswscale/swscale_unscaled.c | 3 +++
>  17 files changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index 3a1e72e1c6..f2b4fd2c62 100755
> --- a/configure
> +++ b/configure
> @@ -4568,7 +4568,7 @@ set >> $logfile
>  test -n "$valgrind" && toolchain="valgrind-memcheck"
>
>  enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize="  && ! echo
> $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
> -add_cflags  -fsanitize=address,undefined
> -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
> +add_cflags  -fsanitize=address,undefined
> -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
> -fno-sanitize-recover=all
>  add_ldflags -fsanitize=address,undefined
> -fsanitize-coverage=trace-pc-guard,trace-cmp
>  }
>
> @@ -4591,7 +4591,7 @@ add_sanitizer_flags(){
>  add_ldflags -fsanitize=thread
>  ;;
>  usan)
> -add_cflags  -fsanitize=undefined
> +add_cflags  -fsanitize=undefined -fno-sanitize-recover=all
>  add_ldflags -fsanitize=undefined
>  ;;
>  ?*)
> diff --git a/libavcodec/aacenc_pred.c b/libavcodec/aacenc_pred.c
> index a486c44d42..9fd119852c 100644
> --- a/libavcodec/aacenc_pred.c
> +++ b/libavcodec/aacenc_pred.c
> @@ -148,6 +148,7 @@ static inline int
> update_counters(IndividualChannelStream *ics, int inc)
>  return 0;
>  }
>
> +__attribute__((no_sanitize("bounds")))  // FIXME: Remove.
>  void ff_aac_adjust_common_pred(AACEncContext *s, ChannelElement *cpe)
>  {
>  int start, w, w2, g, i, count = 0;
> diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
> index 7845815873..c0e29dcac1 100644
> --- a/libavcodec/ffv1dec.c
> +++ b/libavcodec/ffv1dec.c
> @@ -263,6 +263,7 @@ static void slice_set_damaged(FFV1Context *f,
> FFV1SliceContext *sc)
>  f->frame_damaged = 1;
>  }
>
> +__attribute__((no_sanitize("pointer-overflow")))  // FIXME: Remove.
>  static int decode_slice(AVCodecContext *c, void *arg)
>  {
>  FFV1Context *f= c->priv_data;
> diff --git a/libavcodec/ffv1enc_template.c b/libavcodec/ffv1enc_template.c
> index bc14926ab9..786402b9f7 100644
> --- a/libavcodec/ffv1enc_template.c
> +++ b/libavcodec/ffv1enc_template.c
> @@ -22,6 +22,7 @@
>
>  #include "ffv1_template.c"
>
> +__attribute__((no_sanitize("pointer-overflow")))  // FIXME: Remove.
>  static av_always_inline int
>  RENAME(encode_line)(FFV1Context *f, FFV1SliceContext *sc,
>  void *logctx,
> diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
> index fe2f6378b4..7829a8ce1b 100644
> --- a/libavcodec/get_bits.h
> +++ b/libavcodec/get_bits.h
> @@ -511,6 +511,7 @@ static inline unsigned int
> show_bits_long(GetBitContext *s, int n)
>   * @param bit_size the size of the buffer in bits
>   * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would
> overflow.
>   */
> +__attribute__((no_sanitize("pointer-overflow")))  // FIXME: Remove.
>  static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
>  int bit_size)
>  {
> diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
> index fbabd4b6ad..bd976f2854 100644
> --- a/libavcodec/indeo3.c
> +++ b/libavcodec/indeo3.c
> @@ -427,7 +427,7 @@ if (*data_ptr >= last_ptr) \
>   (AV_RN16(dst + row_offset + 2) +
> delta_tab->deltas[dyad2]) & 0x7F7F);\
>  }
>
> -
> +__attribute__((no_sanitize("pointer-overflow")))  // FIXME: Remove.
>  static int decode_cell_data(Indeo3DecodeContext *ctx, Cell *cell,
>  uint8_t *block, uint8_t *ref_block,
>  ptrdiff_t row_offset, int h_zoom, int v_zoom,
> int mode,
> diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
> index e4f17fb2d8..d618425a44 100644
> --- a/libavcodec/motion_est.c
> +++ b/libavcodec/motion_est.c
> @@ -79,6 +79,7 @@ static int minima_cmp(const void *a, const void *b){
>  #define FLAG_CHROMA 2
>  #define FLAG_DIRECT 4
>
> +__attribute__((no_sanitize("pointer-overflow")))  // FIXME: Remove.
>  stati

[FFmpeg-devel] [PATCH] avcodec/hevc/hevcdec: Don't add to null pointer

2025-01-16 Thread Vitaly Buka via ffmpeg-devel
`POS(1,` and `POS(2,` may trigger UBSAN report:
"runtime error: applying non-zero offset 304 to null pointer"

Looks like values are not used without `chroma_format_idc`,
so maybe there is no other issues than the UB.

Can't reproduce with "fate".

Signed-off-by: Vitaly Buka 
---
 libavcodec/hevc/hevcdec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 3655ed0039..7d3e844945 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -2040,9 +2040,10 @@ static void hls_prediction_unit(HEVCLocalContext *lc,
 int x0, int y0, int nPbW, int nPbH,
 int log2_cb_size, int partIdx, int idx)
 {
-#define POS(c_idx, x, y)   
   \
+#define POS(c_idx, x, y)   
   \
+&s->cur_frame->f->data[c_idx] ?
   \
 &s->cur_frame->f->data[c_idx][((y) >> sps->vshift[c_idx]) * 
linesize[c_idx] + \
-   (((x) >> sps->hshift[c_idx]) << sps->pixel_shift)]
+   (((x) >> sps->hshift[c_idx]) << sps->pixel_shift)] 
: NULL
 const HEVCContext *const s = lc->parent;
 int merge_idx = 0;
 struct MvField current_mv = {{{ 0 }}};
-- 
2.48.0.rc2.279.g1de40edade-goog

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/2] .gitignore: ignore fate-suite

2025-01-16 Thread Vitaly Buka via ffmpeg-devel
Sorry, I messed up my subscription, so will reply slightly off-thread.


Timo Rothenpieler via ffmpeg-devel wrote:

> I don't think the fate-suite should be sitting in the source tree.

> Also, there is no guarantee every user/developer will name it that exact
> name? Or is that where it gets synced to be default, if no path is
> specified? I thought that'd just produce an error.

It's not default, I just was following
https://ffmpeg.org/fate.html#toc-Using-FATE-from-your-FFmpeg-source-directory
and ended up with fate-suite there. So maybe it's very common.


On Thu, Jan 16, 2025 at 11:12 AM Vitaly Buka  wrote:

> Signed-off-by: Vitaly Buka 
> ---
>  .gitignore | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/.gitignore b/.gitignore
> index 9cfc78b414..6fcbddad3c 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -43,3 +43,4 @@
>  /tools/python/__pycache__/
>  /libavcodec/vulkan/*.c
>  /libavfilter/vulkan/*.c
> +/fate-suite/
> --
> 2.48.0.rc2.279.g1de40edade-goog
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".