aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2011-12-21 12:00:04 +0100
committerTomas Härdin <tomas.hardin@codemill.se>2011-12-21 14:18:08 +0100
commitcc1dda851b082826e652d698a9ca4738fc2a0ea5 (patch)
tree1c5b31197583cd6a7e34203351947e55bcdcea7b
parent0cd21ddaed5bd9e55fd4bb46f0a9e101b631cfc8 (diff)
downloadffmpeg-cc1dda851b082826e652d698a9ca4738fc2a0ea5.tar.gz
mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows
-rw-r--r--libavformat/mxfdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 50dc3a8053..47fa81d495 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1745,7 +1745,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;
@@ -1763,7 +1763,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;