mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:21:11 +01: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:
parent
0056d9f176
commit
e5ab2dab2c
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue