mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
matroskadec: add assert on lack of overflow in pkt_size+offset
currently a overflow there should be impossible but future changes to the code could easily introduce a bug that no longer limits the 2 values sufficiently so better protect it via av_assert. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
4b7c52346a
commit
59c122b3b0
@ -2053,6 +2053,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
|
||||
offset = matroska_decode_buffer(&pkt_data,&pkt_size, track);
|
||||
if (offset < 0)
|
||||
continue;
|
||||
av_assert0(offset + pkt_size >= pkt_size);
|
||||
}
|
||||
|
||||
pkt = av_mallocz(sizeof(AVPacket));
|
||||
|
Loading…
Reference in New Issue
Block a user