Skip to content
Snippets Groups Projects
Commit 3bf39f2a authored by Karsten Otto's avatar Karsten Otto Committed by Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent eb776a16
No related branches found
No related tags found
No related merge requests found
...@@ -62,6 +62,9 @@ static inline int ff_mpa_check_header(uint32_t header){ ...@@ -62,6 +62,9 @@ static inline int ff_mpa_check_header(uint32_t header){
/* header */ /* header */
if ((header & 0xffe00000) != 0xffe00000) if ((header & 0xffe00000) != 0xffe00000)
return -1; return -1;
/* version check */
if ((header & (3<<19)) == 1)
return -1;
/* layer check */ /* layer check */
if ((header & (3<<17)) == 0) if ((header & (3<<17)) == 0)
return -1; return -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment