mirror of https://git.ffmpeg.org/ffmpeg.git
nutdec: check maxpos in read_sm_data before returning success
Otherwise sm_size can be larger than size, which results in a negative packet size. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit6b9fdf7f4f
) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commiteddf146ada
) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
fdf166c5d2
commit
a3d3e0a6bc
|
@ -950,6 +950,9 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int
|
|||
AV_WL32(dst+4, skip_end);
|
||||
}
|
||||
|
||||
if (avio_tell(bc) >= maxpos)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue