[FFmpeg-cvslog] libavcodec/mpegaudiodecheader.h : detect reserved mpeg id

Karsten Otto git at videolan.org
Mon Jul 9 04:27:39 EEST 2018


ffmpeg | branch: master | Karsten Otto <ottoka at posteo.de> | Sun Jul  8 12:26:10 2018 +0200| [3bf39f2aeff0defcc11454c497b6ea0ffbcd17ca] | committer: Michael Niedermayer

libavcodec/mpegaudiodecheader.h : detect reserved mpeg id

Check the MPEG version ID for the reserved bit pattern 01, and abort the
header check in that case. This reduces the chance of misinterpreting
arbitrary data as a valid header, and prevents resulting audio artifacts.

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/mpegaudiodecheader.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/mpegaudiodecheader.h b/libavcodec/mpegaudiodecheader.h
index 1cb9216461..ed9961250a 100644
--- a/libavcodec/mpegaudiodecheader.h
+++ b/libavcodec/mpegaudiodecheader.h
@@ -62,6 +62,9 @@ static inline int ff_mpa_check_header(uint32_t header){
     /* header */
     if ((header & 0xffe00000) != 0xffe00000)
         return -1;
+    /* version check */
+    if ((header & (3<<19)) == 1)
+        return -1;
     /* layer check */
     if ((header & (3<<17)) == 0)
         return -1;



More information about the ffmpeg-cvslog mailing list