Commit 9123950b authored by Tomas Härdin's avatar Tomas Härdin Committed by Diego Biurrun

mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows

Signed-off-by: 's avatarDiego Biurrun <diego@biurrun.de>
parent d00257e9
......@@ -1798,7 +1798,7 @@ static void mxf_packet_timestamps(MXFContext *mxf, AVPacket *pkt)
return;
/* 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)
break;
......@@ -1817,7 +1817,7 @@ static void mxf_packet_timestamps(MXFContext *mxf, AVPacket *pkt)
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;
pkt->dts = mxf->current_edit_unit + t->first_dts;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment