diff mbox series

[FFmpeg-devel,1/2] fftools: do not access out of bounds filtergraph

Message ID D4K2POA9C1W8.2EICNLIO9SHPX@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,1/2] fftools: do not access out of bounds filtergraph | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marvin Scholz Oct. 1, 2024, 12:57 a.m. UTC
The log message was logged for `filtergraphs[j]` which would cause a
heap buffer overflow in certain circumstances.

Correctly it should be logged for the current filtergraph, so just
use `fg` here.
---
 fftools/ffmpeg_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 545de54e3e0ce5ad1285aa5e111e6657ad803f79

Comments

Anton Khirnov Oct. 3, 2024, 5:04 p.m. UTC | #1
Quoting Marvin Scholz (2024-10-01 02:57:11)
> The log message was logged for `filtergraphs[j]` which would cause a
> heap buffer overflow in certain circumstances.
> 
> Correctly it should be logged for the current filtergraph, so just
> use `fg` here.
> ---
>  fftools/ffmpeg_filter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM and should be backported.
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 463245d9b0..e9271e74ed 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1409,7 +1409,7 @@  int fg_finalise_bindings(void)
         for (int j = 0; j < fg->nb_outputs; j++) {
             OutputFilter *output = fg->outputs[j];
             if (!output->bound) {
-                av_log(filtergraphs[j], AV_LOG_FATAL,
+                av_log(fg, AV_LOG_FATAL,
                        "Filter %s has an unconnected output\n", output->name);
                 return AVERROR(EINVAL);
             }