summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2012-01-26 13:21:41 +0100
committerDiego Biurrun <diego@biurrun.de>2012-02-09 12:54:14 +0100
commit9123950be0dbbfceacb38c0a9b09fdb01ae5b111 (patch)
treedea25b72073eacdd0107fcd3a5958307a37da42f
parentd00257e96a777587085edc411a45fd3e6ca27939 (diff)
mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows
Signed-off-by: Diego Biurrun <diego@biurrun.de>
-rw-r--r--libavformat/mxfdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 25d8c2b4c6..5043d4eee3 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -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;