OSDN Git Service

mxfdec: fix off by one error.
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 26 Mar 2012 13:05:02 +0000 (15:05 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 26 Mar 2012 13:05:02 +0000 (15:05 +0200)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mxfdec.c

index 85de3a7..5910ccd 100644 (file)
@@ -1077,7 +1077,7 @@ static int mxf_edit_unit_absolute_offset(MXFContext *mxf, MXFIndexTable *index_t
                 if (s->nb_index_entries == 2 * s->index_duration + 1)
                     index *= 2;     /* Avid index */
 
-                if (index < 0 || index > s->nb_index_entries) {
+                if (index < 0 || index >= s->nb_index_entries) {
                     av_log(mxf->fc, AV_LOG_ERROR, "IndexSID %i segment at %"PRId64" IndexEntryArray too small\n",
                            index_table->index_sid, s->index_start_position);
                     return AVERROR_INVALIDDATA;