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

Michael Niedermayer git at videolan.org
Sun Apr 14 20:35:13 EEST 2024


ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Mon Feb 12 19:40:07 2024 +0100| [e5c1bcee0368af8b459a7c88f5559bb97578924d] | committer: Michael Niedermayer

avfilter/vf_signature: Dont crash on no frames

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 3d5f03bbc8bba2929cc09b07d2731ae5d392e772)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5c1bcee0368af8b459a7c88f5559bb97578924d
---

 libavfilter/vf_signature.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
index 7d434328b7..0b364430f6 100644
--- a/libavfilter/vf_signature.c
+++ b/libavfilter/vf_signature.c
@@ -386,6 +386,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);



More information about the ffmpeg-cvslog mailing list