mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/ty: do not overread chunk
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
cdd19e2c56
commit
a29a0aba79
|
@ -249,7 +249,11 @@ static int analyze_chunk(AVFormatContext *s, const uint8_t *chunk)
|
||||||
* in MPEG packets to determine tivo_type */
|
* in MPEG packets to determine tivo_type */
|
||||||
if (ty->tivo_type == TIVO_TYPE_UNKNOWN) {
|
if (ty->tivo_type == TIVO_TYPE_UNKNOWN) {
|
||||||
uint32_t data_offset = 16 * num_recs;
|
uint32_t data_offset = 16 * num_recs;
|
||||||
|
|
||||||
for (i = 0; i < num_recs; i++) {
|
for (i = 0; i < num_recs; i++) {
|
||||||
|
if (data_offset + hdrs[i].rec_size > CHUNK_SIZE)
|
||||||
|
break;
|
||||||
|
|
||||||
if ((hdrs[i].subrec_type << 0x08 | hdrs[i].rec_type) == 0x3c0 && hdrs[i].rec_size > 15) {
|
if ((hdrs[i].subrec_type << 0x08 | hdrs[i].rec_type) == 0x3c0 && hdrs[i].rec_size > 15) {
|
||||||
/* first make sure we're aligned */
|
/* first make sure we're aligned */
|
||||||
int pes_offset = find_es_header(ty_MPEGAudioPacket,
|
int pes_offset = find_es_header(ty_MPEGAudioPacket,
|
||||||
|
|
Loading…
Reference in New Issue