File ffmpeg-CVE-2021-38171.patch of Package ffmpeg.32491

diff --unified --recursive --text --new-file --color ffmpeg-3.4.2.old/libavformat/adtsenc.c ffmpeg-3.4.2.new/libavformat/adtsenc.c
--- ffmpeg-3.4.2.old/libavformat/adtsenc.c	2021-09-01 13:46:36.295722415 +0800
+++ ffmpeg-3.4.2.new/libavformat/adtsenc.c	2021-09-01 13:48:44.571493598 +0800
@@ -50,9 +50,11 @@
     GetBitContext gb;
     PutBitContext pb;
     MPEG4AudioConfig m4ac;
-    int off;
+    int off, ret;
 
-    init_get_bits(&gb, buf, size * 8);
+    ret = init_get_bits8(&gb, buf, size);
+    if (ret < 0)
+        return ret;
     off = avpriv_mpeg4audio_get_config(&m4ac, buf, size * 8, 1);
     if (off < 0)
         return off;
openSUSE Build Service is sponsored by