diff mbox series

[FFmpeg-devel] avfilter/vf_signature: Dont crash on no frames

Message ID 20240213020759.4284-1-michael@niedermayer.cc
State Accepted
Commit 3d5f03bbc8bba2929cc09b07d2731ae5d392e772
Headers show
Series [FFmpeg-devel] avfilter/vf_signature: Dont crash on no frames | expand

Checks

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

Commit Message

Michael Niedermayer Feb. 13, 2024, 2:07 a.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_signature.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer March 27, 2024, 5:09 p.m. UTC | #1
On Tue, Feb 13, 2024 at 03:07:59AM +0100, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/vf_signature.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]
diff mbox series

Patch

diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
index 4896e8f2c11..53ed413a4ce 100644
--- a/libavfilter/vf_signature.c
+++ b/libavfilter/vf_signature.c
@@ -384,6 +384,9 @@  static int xml_export(AVFilterContext *ctx, StreamContext *sc, const char* filen
     FILE* f;
     unsigned int pot3[5] = { 3*3*3*3, 3*3*3, 3*3, 3, 1 };
 
+    if (!sc->coarseend->last)
+        return AVERROR(EINVAL); // No frames ?
+
     f = avpriv_fopen_utf8(filename, "w");
     if (!f) {
         int err = AVERROR(EINVAL);