mirror of https://git.ffmpeg.org/ffmpeg.git
mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows
This commit is contained in:
parent
0cd21ddaed
commit
cc1dda851b
|
@ -1745,7 +1745,7 @@ static void mxf_packet_timestamps(MXFContext *mxf, AVPacket *pkt)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* find mxf->current_edit_unit so that the next edit unit starts ahead of pkt->pos */
|
/* find mxf->current_edit_unit so that the next edit unit starts ahead of pkt->pos */
|
||||||
for (;;) {
|
while (mxf->current_edit_unit >= 0) {
|
||||||
if (mxf_edit_unit_absolute_offset(mxf, t, mxf->current_edit_unit + 1, NULL, &next_ofs, 0) < 0)
|
if (mxf_edit_unit_absolute_offset(mxf, t, mxf->current_edit_unit + 1, NULL, &next_ofs, 0) < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1763,7 +1763,7 @@ static void mxf_packet_timestamps(MXFContext *mxf, AVPacket *pkt)
|
||||||
mxf->current_edit_unit++;
|
mxf->current_edit_unit++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mxf->current_edit_unit >= t->nb_ptses)
|
if (mxf->current_edit_unit < 0 || mxf->current_edit_unit >= t->nb_ptses)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pkt->dts = mxf->current_edit_unit + t->first_dts;
|
pkt->dts = mxf->current_edit_unit + t->first_dts;
|
||||||
|
|
Loading…
Reference in New Issue