You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user