aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Cunningham <chcunningham@chromium.org>2016-11-22 13:54:50 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2017-02-08 20:32:01 +0100
commit693288c3445a66e3b707dd93b173be164e4b5b3c (patch)
treee36f701a5b87901125a2863e8c9f85a837eee1cb
parent3d9c007b6116df30bfa179ae8e9fa54e4b9db2d0 (diff)
downloadffmpeg-693288c3445a66e3b707dd93b173be164e4b5b3c.tar.gz
avformat/mp3dec: fix msan warning when verifying mpa header
MPEG Audio frame header must be 4 bytes. If we fail to read 4 bytes bail early to avoid Use-of-uninitialized-value msan error. Reference https://crbug.com/666874. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ab87df9a47cd31bfcae9acd84c04705a149dfc14) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mp3dec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 56c7f8caee..099ca57d24 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -457,7 +457,8 @@ static int check(AVIOContext *pb, int64_t pos, uint32_t *ret_header)
return CHECK_SEEK_FAILED;
ret = avio_read(pb, &header_buf[0], 4);
- if (ret < 0)
+ /* We should always find four bytes for a valid mpa header. */
+ if (ret < 4)
return CHECK_SEEK_FAILED;
header = AV_RB32(&header_buf[0]);