File ffmpeg-CVE-2020-22044.patch of Package ffmpeg.27460

diff --unified --recursive --text --new-file --color ffmpeg-3.4.2.old/libavformat/nutenc.c ffmpeg-3.4.2.new/libavformat/nutenc.c
--- ffmpeg-3.4.2.old/libavformat/nutenc.c	2021-06-02 15:52:46.102175485 +0800
+++ ffmpeg-3.4.2.new/libavformat/nutenc.c	2021-06-03 10:45:15.202999797 +0800
@@ -1170,8 +1170,11 @@
     while (nut->header_count < 3)
         write_headers(s, bc);
 
+    if (!nut->sp_count)
+        return 0;
+
     ret = avio_open_dyn_buf(&dyn_bc);
-    if (ret >= 0 && nut->sp_count) {
+    if (ret >= 0) {
         av_assert1(nut->write_index);
         write_index(nut, dyn_bc);
         put_packet(nut, bc, dyn_bc, 1, INDEX_STARTCODE);
openSUSE Build Service is sponsored by