Hi 0xBat

On Mon, Jan 05, 2026 at 02:11:43AM +0100, 0xBat via ffmpeg-devel wrote:
> Ensure filter_graph is freed on error and validate duration input to prevent 
> integer overflow.

if you have t o write "and" in the commit message, thats generally a sign
that there are 2 independant changes that would be clearer in 2 commits


> 
> Signed-off-by: 0xBat <[email protected]>
> ---
>  doc/examples/filter_audio.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/doc/examples/filter_audio.c b/doc/examples/filter_audio.c
> index ad77bf1f89..bb88f4571b 100644
> --- a/doc/examples/filter_audio.c
> +++ b/doc/examples/filter_audio.c
> @@ -88,6 +88,7 @@ static int init_filter_graph(AVFilterGraph **graph, 
> AVFilterContext **src,
>      abuffer = avfilter_get_by_name("abuffer");
>      if (!abuffer) {
>          fprintf(stderr, "Could not find the abuffer filter.\n");
> +        avfilter_graph_free(&filter_graph);
>          return AVERROR_FILTER_NOT_FOUND;
>      }
>  
> @@ -279,6 +280,10 @@ int main(int argc, char *argv[])
>      }
>  
>      duration  = atof(argv[1]);
> +    if (duration > (double)2147483647 / INPUT_SAMPLERATE) {

hardcoded arbitrary number instead of the named identifer used below


> +        fprintf(stderr, "Duration too long\n");
> +        return 1;
> +    }
>      nb_frames = duration * INPUT_SAMPLERATE / FRAME_SIZE;


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to