mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/evcdec: Check that enough data has been read
Fixes potential use of uninitialized values in evc_read_nal_unit_length(). Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
0056d9f176
commit
e5ab2dab2c
|
@ -162,6 +162,8 @@ static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||
ret = avio_read(s->pb, buf, EVC_NALU_LENGTH_PREFIX_SIZE);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret != EVC_NALU_LENGTH_PREFIX_SIZE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
nalu_size = evc_read_nal_unit_length(buf, EVC_NALU_LENGTH_PREFIX_SIZE);
|
||||
if (!nalu_size || nalu_size > INT_MAX)
|
||||
|
|
Loading…
Reference in New Issue