Commit ab87df9a authored by Chris Cunningham's avatar Chris Cunningham Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent ed412d28
......@@ -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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment