--- branches/dev-api-4/xvidcore/vfw/src/codec.c 2003/12/05 14:44:35 1242 +++ branches/dev-api-4/xvidcore/vfw/src/codec.c 2003/12/06 14:54:00 1245 @@ -489,9 +489,11 @@ int i; for (i=0; inum_zones && config->zones[i].frame <= framenum; i++) ; - i--; - frame->type = config->zones[i].type; + if (--i < 0) return; /* there are no zones, or we're before the first zone */ + + if (framenum == config->zones[i].frame) + frame->type = config->zones[i].type; if (config->zones[i].greyscale) { frame->vop_flags |= XVID_VOP_GREYSCALE;